Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WSFederationAuthenticationModule::SecurityTokenValidated Event

.NET Framework (current version)
 

Occurs after a security token that was received from the security token service (STS) has been validated but before the session security token is created.

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

public:
event EventHandler<SecurityTokenValidatedEventArgs^>^ SecurityTokenValidated {
	void add(EventHandler<SecurityTokenValidatedEventArgs^>^ value);
	void remove(EventHandler<SecurityTokenValidatedEventArgs^>^ value);
}

You can add an event handler to modify the principal created while processing a WS-Federation sign-in response message from a security token service (STS) before it is used to create the session token. In the event handler, you can access the principal through the ClaimsPrincipal property. The SecurityTokenValidated event is a cancelable event, you can set the Cancel property to true in an event handler to terminate processing of the WS-Federation sign-in response message.

This event is raised from inside the OnAuthenticateRequest event-handler delegate when processing a WS-Federation sign-in response message (“wsignin1.0”) received from the security token service (STS). It is raised just after the security token that was deserialized from the wresult or the wresultptr parameter in the sign-in response message has been validated, and before the session security token is created.

void WSFederationAuthenticationModule_SecurityTokenValidated(object sender, SecurityTokenValidatedEventArgs e)
{
    //All vlidation SecurityTokenHandler checks are successful
    System.Diagnostics.Trace.WriteLine("Handling SecurityTokenValidated event");
}

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