Export (0) Print
Expand All

WSFederationAuthenticationModule.CreateSignInRequest Method

.NET Framework 4.5

Creates a WS-Federation sign in request message by using the WS-Federation parameters configured on the module.

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

public SignInRequestMessage CreateSignInRequest(
	string uniqueId,
	string returnUrl,
	bool rememberMeSet
)

Parameters

uniqueId
Type: System.String

The WSFAM saves this value in the wctx parameter in the WS-Federation sign in request; however, the module does not use it when processing sign-in requests or sign-in responses. You can set it to any value. It does not have to be unique.

returnUrl
Type: System.String

The URL to which the module should return upon authentication.

rememberMeSet
Type: System.Boolean

The WSFAM saves this value in the wctx parameter in the WS-Federation sign in request; however, the module does not use it when processing sign-in requests or sign-in responses. You can set it either true or false.

Return Value

Type: System.IdentityModel.Services.SignInRequestMessage
The WS-Federation sign-in request message.

ExceptionCondition
InvalidOperationException

The Issuer property is null or an empty string.

-or-

The Realm property is null or an empty string.

Creates a WS-Federation sign-in request that is represented by a SignInRequestMessage object. The properties of the new SignInRequestMessage object are set as follows:

  • The Context property (the wctx parameter) is set to a value created by using the method parameters.

  • The CurrentTime property (the wct parameter) is set to the current time.

  • All other properties are set by using the equivalent properties of the current instance.

The parameters passed to the method are used to create the wctx message parameter. This is a string with the following format: ru=returnUrl&cx=SignInContext&rm=rememberMeSet&id=uniqueId.

  • The ru value is set to the value of the returnUrl parameter passed in to the method and it specifies the URL that the module should direct the browser to following successful authentication. This is the only value stored in the wctx string that is used by the WSFAM. The module calls the GetReturnUrlFromResponse method to extract this value from the wctx parameter when processing a WS-Federation sign-in response. It should not be confused with the wreply message parameter, which is specified by the Reply property and which provides the address at the RP to which the security token service (STS) should direct its response.

  • The cx parameter is set to the value of the SignInContext property. This property is exposed to enable you to set any application-defined context that should be stored in the wctx string; however, WSFAM does not expose a method to extract this value in the response. If the value is needed by your application, you must provide the code to parse the wctx string and read this value when processing the response. You might accomplish this by overriding the GetReturnUrlFromResponse method.

  • Neither the rm value, which is set to the value of the rememberMeSet parameter, nor the id parameter, which is set to the value of the uniqueId parameter are used by WSFAM. These can be set to any value.

The CreateSignInRequest method is called from the RedirectToIdentityProvider method.

.NET Framework

Supported in: 4.6, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft