Share via


AuthManager.GetProperty Method (PIA)

Use this method to retrieve the value of the specified custom property from the current user ticket.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function GetProperty(enumTicketType As TicketTypeEnum,
  propName As String) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
object GetProperty(TicketTypeEnumenumTicketType,
  stringpropName);

Parameters

[Visual Basic .NET]

  • enumTicketType
    A TicketTypeEnum that indicates the type of ticket that contains the property.
  • propName
    A String that contains the name of the property to retrieve.

[C#]

  • enumTicketType
    A Microsoft.CommerceServer.Interop.TicketTypeEnum value that indicates the type of ticket that contains the property.
  • propName
    A string that contains the name of the property to retrieve.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Object that contains the value for the specified property in the current user ticket. If the property is not found, the returned Object is empty.

[C#] This method returns an object containing a string with the value for the specified property in the current user ticket. If the property is not found, the object is set to null.

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
&HC1004C27 Invalid custom property name or value.
&HC1004C24 This method should only be called within an ASP page.
&HC1004C25 Requested ticket not set.
&HC1004C00 Requested property does not exist on the ticket.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0xC1004C27 Invalid custom property name or value.
0xC1004C24 This method should only be called within an ASP page.
0xC1004C25 Requested ticket not set.
0xC1004C00 Requested property does not exist on the ticket.

Remarks

The following table defines the possible values for the Microsoft.CommerceServer.Interop.TicketTypeEnum.

Name Value Description
ProfileTicketType 1 A TicketTypeEnum ticket used for an anonymous user.
AuthTicketType 2 A TicketTypeEnum ticket used for a registered user.

Use the SetProperty method to place custom property values in the current user ticket.

[C#]

The returned object contains valid string data only if the method completes successfully.

AuthManager myAuth = new AuthManager();

//Use enum parameter this way…

myAuth.SetProperty( TicketTypeEnum.AuthTicketType,

“myCustomProperty”,

“geeWhiz”);

[Visual Basic .NET]

Example

' sPasswordValue is a String
' oAuthManager is a Commerce AuthManager object
sPasswordValue = oAuthManager.GetProperty(AuthTicketType, _
 "Password")

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsauthlib (in mscsauthlib.dll)

See Also

AuthManager Class

AuthManager.SetProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.