AuthManager.SetUserID

Ee824943.c++_on(en-US,CS.10).gifEe824943.vb_off(en-US,CS.10).gif

Use this method to change the user ID property on a ticket.

Definition

Sub SetUserID(enumTicketType As EnumMSCS_TicketType,newUserID As String)

Parameters

enumTicketType

An EnumMSCS_TicketType that indicates the type of ticket that will contain the user ID.

newUserID

A String that contains the unique ID for the current user.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_UPM_AUTHID_INVALID_CHARACTER_PRESENT &HC1004C23 Invalid character (';' or '%' or '=') present in the UserID or the property name/value pair.
E_UPM_AUTHMANAGER_API_ASP_ONLY &HC1004C24 This method should only be called within an ASP page.
MSG_UPM_AUTH_SITE_NEEDED_ERROR &HC1004C10 The Initialize method must be called with the installed site name before calling this method.

Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The value for the user ID may be the logon name for a registered user, a globally unique identifier (GUID) for an anonymous user, or any unique value.

If the appropriate ticket already exists, the value in the user ID is updated. If the ticket already exists and an empty string is passed in as the value for the user ID, newUserID, the existing ticket is deleted.

If the ticket does not exist, a ticket is created with default values for the rest of the data.

The following table defines the possible values for the EnumMSCS_TicketType.

Name Value Description
enumMSCS_ProfileTicketType 1 A MSCSProfile ticket used for an anonymous user.
enumMSCS_AuthTicketType 2 A MSCSAuth ticket used for a registered user.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' oAuthManager is a Commerce AuthManager object

oAuthManager.SetUserID enumMSCS_AuthTicketType, "JoeUser@microsoft.com"

See Also

AuthManager Object


All rights reserved.