CreateFromNameValueCollection Method
Collapse the table of content
Expand the table of content

WSFederationMessage.CreateFromNameValueCollection Method (Uri, NameValueCollection)

.NET Framework (current version)
 

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

Namespace:   System.IdentityModel.Services
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

public static WSFederationMessage CreateFromNameValueCollection(
	Uri baseUrl,
	NameValueCollection collection
)

Parameters

baseUrl
Type: System.Uri

The base URL to which the message is intended.

collection
Type: System.Collections.Specialized.NameValueCollection

The NameValueCollection that contains the parameters for the message.

Return Value

Type: System.IdentityModel.Services.WSFederationMessage

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

Exception Condition
ArgumentNullException

baseUrl is null.

-or-

collection is null.

WSFederationMessageException

The wa parameter in the parameter collection is not recognized.

ArgumentException

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.)

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

--

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft