WSFederationAuthenticationModule.GetReturnUrlFromResponse Method (HttpRequestBase)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Extracts the URL of the page that was originally requested from the sign-in response.

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

protected virtual string GetReturnUrlFromResponse(
	HttpRequestBase request


Type: System.Web.HttpRequestBase

The HTTP request that contains a form POST, which contains the WS-Federation sign-in response message.

Return Value

Type: System.String

The URL of the page that was originally requested by the client. This is the URL (at the relying party) to which the client should be redirected following successful sign-in.

Exception Condition

request is null.

This method is called from the request processing pipeline (the OnAuthenticateRequest method) to get the URL of the page at the relying party (RP) to direct the client to after successful sign-in. This is, typically, the URL of the RP resource to which the client originally requested access.

By default, WSFAM saves the return URL inside the wctx message parameter when it sends the WS-Federation sign-in request to the security token service (STS). In accordance with the WS-Federation specification, the wctx parameter is preserved across entities through which the message passes and is returned unaltered in the WS-Federation sign-in response message that is sent by the STS.

The default implementation gets the return URL from the wctx parameter in the sign-in response. For more information about the format of the wctx parameter that is used by WSFAM, see the CreateSignInRequest method.

.NET Framework
Available since 4.5
Return to top