REST
This commit is contained in:
@@ -3,12 +3,8 @@ Imports System.Net.Http
|
||||
Imports System.Security.Principal
|
||||
Imports System.Threading
|
||||
Imports System.Web.Http.Controllers
|
||||
Imports System.Web.Http.Description
|
||||
Imports System.Web.Http.Filters
|
||||
Imports Microsoft.AspNetCore.Authorization
|
||||
Imports Swashbuckle.Swagger
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +21,7 @@ Public Class BasicAuthenticationAttribute
|
||||
Dim usernamePasswordArray = decodedAuthenticationToken.Split(":"c)
|
||||
Dim userName = usernamePasswordArray(0)
|
||||
Dim password = usernamePasswordArray(1)
|
||||
'Dim hashedPW = BCrypt.Net.BCrypt.HashPassword(password)
|
||||
|
||||
|
||||
|
||||
@@ -51,9 +48,9 @@ Public Class BasicAuthenticationAttribute
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim authenticated As Boolean = False
|
||||
|
||||
Dim Response = SQL.DLookup("username", "tblAuthentication", "username='" & user & "' and password='" & password & "'", "FMZOLL", "")
|
||||
If Response <> "" Then
|
||||
authenticated = True
|
||||
Dim hashedPassword = SQL.DLookup("hashedPassword", "tblRESTAuthentication", "username='" & user & "' AND type = 'REST'", "ADMIN", "")
|
||||
If hashedPassword <> "" Then
|
||||
authenticated = BCrypt.Net.BCrypt.Verify(password, hashedPassword)
|
||||
End If
|
||||
|
||||
Return authenticated
|
||||
|
||||
Reference in New Issue
Block a user