Share via


AuthToken Class

Note: The Microsoft UDDI SDK is not supported by or included in Microsoft Windows versions after Microsoft Windows Server 7. The Microsoft UDDI V3 SDK is included with Microsoft BizTalk Server. For more information about the Microsoft UDDI V3 SDK, see Microsoft BizTalk Server documentation
Represents a token used to identify an authorized user for various UDDI messages on UDDI servers using UDDI authentication. To obtain an instance of this class, use the GetAuthToken.Send method.

Namespace: Microsoft.Uddi
Assembly: microsoft.uddi (in microsoft.uddi.dll)

Usage

Visual Basic
  Dim instance As AuthToken

Syntax

'Declaration
<XmlRootAttribute("authToken", Namespace:="urn:uddi-org:api_v2")> _
PublicClassAuthToken
[XmlRootAttribute("authToken", Namespace="urn:uddi-org:api_v2")] 
publicclassAuthToken
[XmlRootAttribute(L"authToken", Namespace=L"urn:uddi-org:api_v2")] 
publicref classAuthToken
/** @attribute XmlRootAttribute("authToken", Namespace="urn:uddi-org:api_v2") */ 
publicclassAuthToken
XmlRootAttribute("authToken", Namespace="urn:uddi-org:api_v2") 
publicclassAuthToken

Remarks

Authentication tokens are required for all UDDI publishing operations when UDDI authentication (Microsoft.Uddi.AuthenticationMode) is used. For example, the SaveBusiness class requires a valid authentication token in the SaveBusiness.AuthInfo property before the SaveBusiness.Send method will succeed. Authentication tokens are ignored when Windows authentication (Microsoft.Uddi.AuthenticationMode) is used.

To obtain an authentication token, create a GetAuthToken object, fill in the Username and Password properties, and call the GetAuthToken.Send method, which returns an AuthToken object. Then set the AuthInfo property of the message class (SaveBusiness.AuthInfo for example) equal to the AuthToken.AuthInfo property.

Authentication tokens will expire after a time specified by the server. By default, the expiration time is 60 minutes from the time the token is issued by the server. When the authentication token expires, the Send method of the publishing class will throw an AuthTokenExpiredException exception.

To discard an authentication token when it is no longer needed, you create a DiscardAuthToken object, set the DiscardAuthToken.AuthInfo property equal to the AuthToken.AuthInfo property of the token to discard and call the DiscardAuthToken.Send method.

The burden of obtaining, keeping, and discarding an authentication token can be avoided by setting the UddiConnection.AutoGetAuthToken to true. This causes the UddiConnection object to automatically obtain an authentication token if the current token is expired or does not exist. The token will automatically be discarded when the UddiConnection object is destroyed or when the UddiConnection.Close method is called.

Inheritance Hierarchy

System.Object
  Microsoft.Uddi.AuthToken

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

Target Platforms

Windows Server 2008, Windows Server 2003, Windows XP Professional, Windows Vista, Windows Server 2003 R2, Windows XP

See Also

Reference

AuthToken Members
Microsoft.Uddi Namespace