This documentation is archived and is not being maintained.

CreatingCookieEventArgs::CustomCredential Property

Gets additional authentication values that are provided by the user.

Namespace:  System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
property String^ CustomCredential {
	String^ get ();
}

Property Value

Type: System::String
The custom values required for authentication, other than user name and password.

You use the CustomCredential property to retrieve custom values in the authentication ticket. The CustomCredential property contains the value passed to the Login method. Typically, this property is used to pass custom values that must be validated with the user name and password, such as an identification number. If more than one value is stored in the property, you must parse the CustomCredential property in order to retrieve values.

The following example shows an event handler for the CreatingCookie event. The handler retrieves user values from the CreatingCookieEventArgs object in order to customize the authentication cookie. The value passed in the CustomCredential property is stored in the UserData property of the forms authentication ticket.

NoteNote

Store the CustomCredential property in a cookie only when you know that the data in the property is not sensitive. Malicious users can access the values in the cookie.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: