Edit

Share via


WSFederationAuthenticationModule.CreateSignInRequest Method

Definition

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

public:
 System::IdentityModel::Services::SignInRequestMessage ^ CreateSignInRequest(System::String ^ uniqueId, System::String ^ returnUrl, bool rememberMeSet);
public System.IdentityModel.Services.SignInRequestMessage CreateSignInRequest (string uniqueId, string returnUrl, bool rememberMeSet);
member this.CreateSignInRequest : string * string * bool -> System.IdentityModel.Services.SignInRequestMessage
Public Function CreateSignInRequest (uniqueId As String, returnUrl As String, rememberMeSet As Boolean) As SignInRequestMessage

Parameters

uniqueId
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
String

The URL to which the module should return upon authentication.

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

Returns

The WS-Federation sign-in request message.

Exceptions

The Issuer property is null or an empty string.

-or-

The Realm property is null or an empty string.

Remarks

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.

Applies to

See also