Share via


UsernameTokenManager.AuthenticateToken Method

Authenticates a UsernameToken .

Namespace: Microsoft.Web.Services2.Security.Tokens
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)

Usage

'Usage
Public Class usernameTokenManagerImplementation
    Inherits UsernameTokenManager
        Protected Overrides Function AuthenticateToken(token As UsernameToken)
            MyBase.AuthenticateToken(token)
        End Function
End Class

Syntax

'Declaration
Protected Overridable Function AuthenticateToken( _
    ByVal token As UsernameToken _
) As String
protected virtual string AuthenticateToken(
    UsernameToken token
);
protected: String^ AuthenticateToken(
    UsernameToken^ token
);
protected System.String AuthenticateToken(
    UsernameToken token
);
protected function AuthenticateToken(
     token : UsernameToken
) : String;

Parameters

Return Value

The password of the authenticated UsernameToken .

Exceptions

Exception type Condition
SecurityFault

The Password property of token is null.

Remarks

The default implementation authenticates the token parameter against a local Windows account or an Active Directory using the Username and Password properties of the UsernameToken. If the authentication is successful, the Principal property of the UsernameToken is set to a System.Security.Principal.WindowsPrincipal that represents the authenticated user.

WSE calls the VerifyToken method for each UsernameToken contained in an incoming SOAP message after it has been deserialized. The VerifyToken method calls the AuthenticateToken method to get the password for the user. The AuthenticateToken method verifies the user name and password in the SOAP message by calling the LogonUser Win32 function.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone

See Also

Reference

UsernameTokenManager Class
Microsoft.Web.Services2.Security.Tokens Namespace
UsernameToken
OnLogonUserFailed

Other Resources

UsernameTokenManager Members
ms824677(v=msdn.10).md