AuthManager.SetUserID Method (PIA)
Use this method to change the user ID property on a ticket.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop
…
Public Sub SetUserID(enumTicketType As TicketTypeEnum,
newUserID As String)
[C#]
using Microsoft.CommerceServer.Interop;
…
void IMSCSAuthManager::SetUserID(TicketTypeEnumenumTicketType,
stringnewUserID);
Parameters
[Visual Basic .NET]
- enumTicketType
A TicketTypeEnum that indicates the type of ticket that will contain the user ID. - newUserID
A String that contains the unique ID for the current user.
[C#]
- enumTicketType
A Microsoft.CommerceServer.Interop.TicketTypeEnum that indicates the type of ticket that will contain the user ID. - newUserID
A string that contains the unique ID for the current user.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
[Visual Basic .NET]
The following table shows the custom COM errors that this method can return.
Value | Description |
---|---|
&HC1004C23 | Invalid character (';' or '%' or '=') present in the UserID. |
&HC1004C24 | This method should only be called within an ASP page. |
&HC1004C10 | The Initialize method must be called with the installed site name before calling this method. |
&HC1004C40 | The ticket has reached a maximum size of 4 kilobytes. |
[C#]
The following table shows the custom COM errors that a COMException can wrap.
Value | Description |
---|---|
0xC1004C23 | Invalid character (';' or '%' or '=') present in the UserID. |
0xC1004C24 | This method should only be called within an ASP page. |
0xC1004C10 | The Initialize method must be called with the installed site name before calling this method. |
0xC1004C40 | The ticket has reached a maximum size of 4 kilobytes. |
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. However, the ticket created is issued to the browser as a cookie, only if the site code calls SetProfileTicket or SetAuthTicket.
The following table defines the possible values for the Microsoft.CommerceServer.Interop.TicketTypeEnum.
Name | Value | Description |
---|---|---|
ProfileTicketType | 1 | A Profile ticket used for an anonymous user. |
AuthTicketType | 2 | A Auth ticket used for a registered user. |
[Visual Basic .NET]
Example
' oAuthManager is a Commerce AuthManager object
oAuthManager.SetUserID (AuthTicketType, JoeUser@microsoft.com)
Requirements
Namespace: Microsoft.CommerceServer.Interop
Platforms: Windows 2000, Windows Server 2003
Assembly: mscsauthlib (in mscsauthlib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.