Login Problem behoben am Desktop

This commit is contained in:
ja
2022-02-14 11:24:26 +01:00
parent 46723f8567
commit ccb0eb652f
2 changed files with 30 additions and 18 deletions

View File

@@ -171,8 +171,8 @@ Partial Class login_FLEX
reqfieldvalpassw.Validate()
If reqfieldvalpassw.IsValid = True Then
intzahl = VERAG_VARIABLES.RandomInteger(107, Math.Pow(2, 10))
Dim hashpw1 As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3_M.Text, salt, intzahliterats, intzahl)
passw = tb3_M.Text
Dim hashpw1 As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3.Text, salt, intzahliterats, intzahl)
passw = tb3.Text
End If
End If
@@ -214,12 +214,12 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(8)
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!"
End If
If String.Equals(tb3.Text, dr("Password")) = True Then
If String.Equals(tb3.Text, dr("Password").ToString) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), Math.Pow(2, 10))
salt = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3.Text, salt, intzahliterats, intzahl)
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
passw = dr("Password").ToString
passw = tb3.Text
Else
passw = String.Empty
End If
@@ -227,12 +227,22 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(9)
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!"
End If
If String.IsNullOrEmpty(tb2.Text) = False AndAlso String.IsNullOrEmpty(tb2_M.Text) = True And String.Equals(tb.Text, dr("KundenNr").ToString) = True AndAlso String.Equals(tb2.Text, dr("Username").ToString) = True AndAlso String.Equals(tb3.Text, dr("Password").ToString) = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, cb.Checked)
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End If
'MsgBox("Erfolgreich validiert.")
Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID)
Session.Add("PW", passw)
Exit Select
setDBLastLoggedIn(tb2.Text)
'setDBLastLoggedIn(tb2.Text)
End Select
End If
dr.Close()
@@ -240,15 +250,7 @@ Partial Class login_FLEX
End Using
End Using
If String.IsNullOrEmpty(tb2_M.Text) = False AndAlso String.IsNullOrEmpty(tb2.Text) = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, cb.Checked)
End If
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End Sub
Protected Async Sub ValidateUser_M(sender As Object, e As EventArgs) Handles Login2.Authenticate
Dim ConnectionString = ""
@@ -365,9 +367,9 @@ Partial Class login_FLEX
If String.Equals(tb3_M.Text, dr("Password")) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), 0.78 * VERAG_VARIABLES.GetCpuSpeed)
salt = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3_M.Text, salt, intzahliterats, intzahl)
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
passw = dr("Password").ToString
passw = tb3_M.Text
Else
passw = String.Empty
End If
@@ -375,7 +377,17 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(9)
Login2.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!"
End If
setDBLastLoggedIn_M(UserNaMe)
If String.IsNullOrEmpty(tb2_M.Text) = True AndAlso String.IsNullOrEmpty(tb2.Text) = False And String.Equals(tb_M.Text, dr("KundenNr").ToString) = True AndAlso String.Equals(tb2_M.Text, dr("Username").ToString) = True AndAlso String.Equals(tb3_M.Text, dr("Password").ToString) = True Then
FormsAuthentication.SetAuthCookie(Login2.UserName, cb.Checked)
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End If
'setDBLastLoggedIn_M(UserNaMe)
'MsgBox("Erfolgreich validiert.")
Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID)