usernameTokenManager class (SQL)

hcti

New member
Joined
Feb 22, 2006
Messages
2
Programming Experience
Beginner
i found a hand on lab about the WSE 2.0 Security & policy in vb.net but this lab used the window application and active directory in computer as datatabase.

i need to do the web service security in web base and connected to SQL server database, and now i face the problem in UsernametokenManager class which i need to change the original code(compare the username with account in active directory) to new coding(compare the username and password to SQL server). I have no idea how to edit it. Anybody can help me? The original coding is as below:

Public Class MyUsernameTokenManager
Inherits UsernameTokenManager

Protected Overrides Function AuthenticateToken(ByVal token _
As UsernameToken) As String

Dim roles As New ArrayList()
Select Case token.Username
Case "admin"

// i need to change this part in order connect to SQL server
roles.Add(String.Format("{0}\User", _
Dns.GetHostName()))
roles.Add(String.Format("{0}\Vendor", _
Dns.GetHostName()))
roles.Add(String.Format("{0}\Accounting", _
Dns.GetHostName()))
token.Principal = New GenericPrincipal( _
New GenericIdentity(token.Username), _
roles.ToArray(GetType(String)))
Case "mike"
roles.Add(String.Format("{0}\User", _
Dns.GetHostName()))
roles.Add(String.Format("{0}\Manager", _
Dns.GetHostName()))
token.Principal = New GenericPrincipal( _
New GenericIdentity(token.Username), _
roles.ToArray(GetType(String)))
Case Else
MyBase.AuthenticateToken(token)
End Select
Return "password"

End Function 'AuthenticateToken
End Class 'MyUsernameTokenManager



I stuck in this problem about 1month already, hope somebody can help me...
Thanks...
 
Back
Top