AuthManager.SetAuthTicket

Ee825236.c++_on(en-US,CS.10).gifEe825236.vb_off(en-US,CS.10).gif

Use this method to set an encrypted MSCSAuth ticket for a registered user.

Definition

Sub SetAuthTicket(UserID As String,fCookieSupport As Boolean,TimeWindow As Long)

Parameters

UserID

[in] A String that contains the unique ID for the current user.

fCookieSupport

[in] A Boolean that indicates whether session cookies are supported.

TimeWindow

[in] A Long that defines the time window in minutes that the MSCSAuth ticket is valid.

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 time the user last logged in is stored in the ticket, along with the length of time from the last login that the ticket is valid.

If an MSCSAuth ticket for the user already exists and an empty string is passed in as the ID, UserID, for the user, the existing ticket is deleted.

If the current user is anonymous, use the SetProfileTicket method to generate an MSCSProfile ticket.

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.SetAuthTicket "JoeUser@microsoft.com", True, 30

See Also

AuthManager Object

AuthManager.IsAuthenticated


All rights reserved.