SetUserCredentials(string, string, object[]) Method

The SetUserCredentials method of the Credentials class sets credentials for the user for the specified enterprise application definition.

Parameters

strApplicationName The name of the enterprise application definition. The maximum allowed number of characters is 128.

strUserAccount The domain and user account name (domain_name\user_name). The maximum allowed number of characters is 272.

Args Array of *strings that contains the credentials. The *SetUSerCredentials method uses only the first five string parameters in the Args parameter for the credentials. The order of the credentials in the Args array determines the order in which the credentials are stored and retrieved. There is a size limit on each credential string. Each credential string can contain a maximum number of 8000 characters.

Exceptions

Exception Type Condition
SingleSignonException Method has failed, incorrect permissions, or absence of strApplicationName in the single sign-on database.

Remarks

Only members of the single sign-on administrator account or the application manager account can call the SetUserCredentials method. The SetUserCredentials method is audited with the result of success or failure and the account name that calls the method in single sign-on database. The ServiceAction enumeration recorded is SetUserCredentials.

Example

The following code example shows SetUserCredentials method. To use this example, replace domain_name\\group_name with a valid domain and group on your network.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security