IMSCSAuthManager2::SetProperty Method [C++]

Use this method to place a custom property name/value pair into the current ticket for the user.

Definition

[C++]

HRESULT IMSCSAuthManager::SetProperty(EnumMSCS_TicketTypeenumTicketType,
  BSTRpropName,
  BSTRpropVal);

[Visual Basic]

Sub SetProperty(EnumMSCS_TicketTypeenumTicketType,
  propName As String,
  propVal As String)

Parameters

  • enumTicketType[C++]
    [in] An EnumMSCS_TicketType that indicates the type of ticket.
  • enumTicketType[Visual Basic]
    [in] An EnumMSCS_TicketType that indicates the type of ticket.
  • propName[C++]
    [in] A BSTR that contains the name of the property.
  • propName[Visual Basic]
    [in] A String that contains the name of the property.
  • propVal[C++]
    [in] A BSTR that contains the value corresponding to the named property.
  • propVal[Visual Basic]
    [in] A String that contains the value corresponding to the named property.

[C++]

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

[Visual Basic] 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 [C++] 0xC1004C23

[Visual Basic] &HC1004C23

Invalid character (';' or '=') present in the property name/value pair.
E_UPM_AUTHID_INVALID_PROPERTY [C++] 0xC1004C27

[Visual Basic] &HC1004C27

Invalid custom property name or value.
E_UPM_AUTHMANAGER_API_ASP_ONLY [C++] 0xC1004C24

[Visual Basic] &HC1004C24

This method should only be called within an ASP page.
MSG_UPM_AUTH_SITE_NEEDED_ERROR [C++] 0xC1004C10

[Visual Basic] &HC1004C10

The Initialize method must be called with the installed site name before calling this method.
MSG_UPM_AUTHID_TICKET_MAX_REACHED [C++] 0xC1004C40

[Visual Basic] &HC1004C40

The ticket has reached a maximum size of 4 Kilobytes of data.

[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

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

Remarks

Use the GetProperty method to retrieve the custom property values from the current ticket.

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.

[Visual Basic]

If the user does not already have an appropriate ticket, call SetAuthTicket or SetProfileTicket to obtain the ticket before calling this method. If this method is called while the user does not have an appropriate ticket, the user will be sent a cookie with the property, but no ticket.

[C++]

If the user does not already have an appropriate ticket, call SetAuthTicket or SetProfileTicket to obtain the ticket before calling this method. If this method is called while the user does not have an appropriate ticket, the user will be sent a cookie with the property, but no ticket.

This method will set the ticket in a cookie if the client browser supports cookies, otherwise, a subsequent call to the GetURL method will be required to set the ticket in the URL.

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

[Visual Basic]

Example

' oAuthManager is a Commerce AuthManager object

oAuthManager.SetAuthTicket "JoeUser@microsoft.com", True, 30

' These two method calls do not have to be consecutive, 
' or even in the same script, but do need to be in this order.

oAuthManager.SetProperty enumMSCS_AuthTicketType, "Password", "MyPassword123"

See Also

[C++]AuthManager Object

[C++]IMSCSAuthManager::GetProperty

[Visual Basic]AuthManager Object

[Visual Basic]AuthManager.GetProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.