FederatedPassiveSecurityTokenServiceOperations.ProcessRequest Method (HttpRequest, ClaimsPrincipal, SecurityTokenService, HttpResponse)

.NET Framework (current version)
 

Processes an incoming WS-Federation Passive Protocol request.

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

public static void ProcessRequest(
	HttpRequest request,
	ClaimsPrincipal principal,
	SecurityTokenService sts,
	HttpResponse response
)

Parameters

request
Type: System.Web.HttpRequest

The incoming HTTP request.

principal
Type: System.Security.Claims.ClaimsPrincipal

The principal associated with this request.

sts
Type: System.IdentityModel.SecurityTokenService

The security token service (STS) to use to issue tokens.

response
Type: System.Web.HttpResponse

The outgoing HTTP response.

Exception Condition
ArgumentNullException

request is null.

-or-

principal is null.

-or-

sts is null.

-or-

response is null.

The code example that is used in this topic is taken from the Custom Token sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT), and it includes an implementation of a passive STS that is capable of serving an SWT token. For information about this sample and other samples available for WIF and about where to download them, see WIF Code Sample Index. The following code shows how to invoke a custom passive STS to process a WS-Federation request by calling the ProcessRequest(HttpRequest, ClaimsPrincipal, SecurityTokenService, HttpResponse) method from the code behind in the default.aspx.cs file.

using System;
using System.IdentityModel.Services;
using System.Security.Claims;

namespace PassiveSTS
{
    public partial class _Default : System.Web.UI.Page
    {
        /// <summary>
        /// We perform the WS-Federation Passive Protocol processing in this method. 
        /// </summary>
        protected void Page_PreRender( object sender, EventArgs e ) 
        {
            FederatedPassiveSecurityTokenServiceOperations.ProcessRequest( Request, User as ClaimsPrincipal, CustomSecurityTokenServiceConfiguration.Current.CreateSecurityTokenService(), Response );
        }
    }
}

.NET Framework
Available since 4.5
Return to top
Show: