WSFederationMessage.CreateFromNameValueCollection Method

Definition

Creates a WS-Federation message from a NameValueCollection of parameters.

public:
 static System::IdentityModel::Services::WSFederationMessage ^ CreateFromNameValueCollection(Uri ^ baseUrl, System::Collections::Specialized::NameValueCollection ^ collection);
public static System.IdentityModel.Services.WSFederationMessage CreateFromNameValueCollection (Uri baseUrl, System.Collections.Specialized.NameValueCollection collection);
static member CreateFromNameValueCollection : Uri * System.Collections.Specialized.NameValueCollection -> System.IdentityModel.Services.WSFederationMessage
Public Shared Function CreateFromNameValueCollection (baseUrl As Uri, collection As NameValueCollection) As WSFederationMessage

Parameters

baseUrl
Uri

The base URL to which the message is intended.

collection
NameValueCollection

The NameValueCollection that contains the parameters for the message.

Returns

The message that was created or null if a message cannot be created.

Exceptions

baseUrl is null.

-or-

collection is null.

The wa parameter in the parameter collection is not recognized.

A sign-in response message has both the wresult and wresultptr parameter in the parameter collection. (A valid sign-in response message has the wa parameter equal to "wsignin1.0" and either the wresult or the wresultptr parameter, but not both.)

Remarks

The parameter collection must contain an entry for the wa parameter, which specifies the action to be performed. If the wa entry is not a recognized action, an exception is thrown. The parameter collection should contain appropriate parameters for the kind of message specified by the wa parameter in the collection. The method will return an appropriate implementation of WSFederationMessage based on the wa parameter. The following table lists the WSFederationMessage implementation returned for various parameter combinations.

Type returned wa query parameter specified Comments
AttributeRequestMessage wattr1.0 --
PseudonymRequestMessage wpseudo1.0 --
SignInRequestMessage wsignin1.0 collection must contain either a wtrealm or a wreply parameter. If collection contains a wresult or a wresultptr parameter, a sign-in response message is returned (see next row).
SignInResponseMessage wsignin1.0 Returned if collection contains a wresult or wresultptr parameter. Only one may be present. If both are present, an exception is thrown.
SignOutRequestMessage wsignout1.0 --
SignOutCleanupRequestMessage wsignoutcleanup1.0 --

Applies to