Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Web.Services.Protocols
- Public Class ServiceCredentials
- Inherits SoapHeader
- Private _userName As String
- Public Property UserName() As String
- Get
- Return _userName
- End Get
- Set(ByVal value As String)
- _userName = value
- End Set
- End Property
- Private _password As String
- Public Property Password() As String
- Get
- Return _password
- End Get
- Set(ByVal value As String)
- _password = value
- End Set
- End Property
- Public Sub New()
- End Sub
- Public Sub NewUserInfo(ByVal ServiceUser As String, ByVal ServicePassword As String)
- Me.UserName = ServiceUser
- Me.Password = ServicePassword
- End Sub
- <WebMethod()> _
- <SoapHeader("CredentialsHeader")> _
- Function MyWebMethod(ByVal paremetersPassed as String)
- 'check permissions here
- If PermissionsValid(CredentialsHeader) then
- 'ok!
- .......
- else
- 'throw a permission error
- end if
- End Function
- Function PermissionsValid(byval Credentials as ServiceCredentials) as boolean
- 'check Credentials.Username and Credentials.Password here and return a boolean
- End Function
- if User.IsAuthenticated
- Browser <-(1)-> ASP/.NET App (`https://123.com/app`) <-(2)-> Web Service (`https://456.com/ws`)
Add Comment
Please, Sign In to add comment