Author |
Topic  |
|
Dexterp37
Starting Member
7 Posts |
Posted - 19 May 2005 : 15:01:04
|
Hello!
I hope this post fits in this section otherwise.. i'm very sorry :)
I just had to integrate snitz forum with an ASP.NET portal with the ability to add forum user from an outisde registration page (i'm using forum database as portal users database). The registration works ok, i just have a problem when authenticating with the forum.. it says my username or password are wrong!
I'm pretty sure password encryption is ok because i just ported the sha256 file to .NET and it produces same output as normal ASP function. When registrating, i simply SHA the clear password and save it to the database along with username and email and other data.
Am I missing something?
Thanks in advance! |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
|
Dexterp37
Starting Member
7 Posts |
Posted - 19 May 2005 : 15:14:31
|
code removed by ruirib
Dexterp when posting long pieces of code, please do that as a link to a text file. |
Edited by - ruirib on 21 May 2005 09:30:13 |
 |
|
Dexterp37
Starting Member
7 Posts |
Posted - 19 May 2005 : 15:16:55
|
But i'm pretty sure this works just because i've checked password created . Outputs are the same! |
 |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
Posted - 19 May 2005 : 15:31:41
|
Ok.
This is simpler and it works.
Public Function SHA256Hash(ByVal InputStr As String) As String
Dim SHA256Hasher As New System.Security.Cryptography.SHA256Managed
Return LCase$(ToHexString(SHA256Hasher.ComputeHash(Encoder.GetBytes(InputStr))))
End Function
Private Function ToHexString(ByVal ByteArray As Byte()) As String
Dim i As Integer
For i = LBound(ByteArray) To UBound(ByteArray)
If Len(Hex(ByteArray(i))) = 1 Then
ToHexString &= "0" & LCase$(Hex(ByteArray(i)))
Else
ToHexString &= LCase$(Hex(ByteArray(i)))
End If
Next
End Function
|
Podge.
The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)
My Mods: CAPTCHA Mod | GateKeeper Mod Tutorial: Enable subscriptions on your board
Warning: The post above or below may contain nuts. |
Edited by - Podge on 19 May 2005 15:32:14 |
 |
|
Dexterp37
Starting Member
7 Posts |
Posted - 21 May 2005 : 07:46:22
|
Still doesnt work :| Password generated from both methods are the same... i just add a new record to FORUM_MEMBERS table, is ther anything else to do? |
 |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
|
Dexterp37
Starting Member
7 Posts |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
|
Dexterp37
Starting Member
7 Posts |
Posted - 26 May 2005 : 15:26:18
|
weird! My query is so simple
// -> Build Query (dirty job) string queryString = "INSERT INTO [FORUM_MEMBERS] "+ "([M_NAME]," + "[M_USERNAME]," + "[M_EMAIL], " + "[M_PASSWORD]," + "[M_CITY], " + "[M_AGE], " + "[M_SEX], " + "[M_DATE], " + "[M_PHOTO_URL]," + "[M_BIO]) " + "VALUES (" + "'" + UserRName.Text + " " + Cognome.Text + "'," + "'" + UserName.Text + "'," + "'" + UserEmail.Text + "'," + "'" + passResult + "'," + "'" + City.Text + "'," + "'" + sAge + "'," + "'" + SexRadioList.SelectedItem.Value + "'," + "'" + sBirthDay + "'," + "'" + sPicUrl + "'," + "'" + UserShortDesc.Text + "')"; |
Edited by - Dexterp37 on 26 May 2005 15:26:51 |
 |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
|
Dexterp37
Starting Member
7 Posts |
Posted - 26 May 2005 : 16:07:03
|
**** :) So the field used for the login is M_NAME and not M_USERNAME? (confusing...)
So (just to be sure) M_NAME -> Stores nickname used for login M_USERNAME -> ? |
 |
|
Podge
Support Moderator
    
Ireland
3776 Posts |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 27 May 2005 : 08:08:40
|
M_USERNAME is used to hold the login name when using NT authentication.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
|
Topic  |
|