Defines the base class from which all the Federation messages classes derive.
Namespace: Microsoft.IdentityModel.Protocols.WSFederation
Assembly: Microsoft.IdentityModel (in microsoft.identitymodel.dll)

Usage

Visual Basic
Dim instance As WSFederationMessage

Syntax

Visual Basic
Public MustInherit Class WSFederationMessage
C#
public abstract class WSFederationMessage
C++
public ref class WSFederationMessage abstract
J#
public abstract class WSFederationMessage
JScript
public abstract class WSFederationMessage

Example

This code snippet illustrates usage of WSFederationMessage to create a SignInRequestMessage:

  Copy Code
 
/// <summary>
/// We perform WS-Federation passive protocol logic in this method and call /// out to the appropriate request handlers. 
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

protected void Page_PreRender( object sender, EventArgs e )
{
// Check whether the user is already authenticated
if ( IsAuthenticatedUser )
	{
	// Use WSFederationMessage.CreateFromUri to parse the request and 
	// create a WSFederationMessage. 
	WSFederationMessage federationMessage = WSFederationMessage.CreateFromUri( Request.Url );

	if ( federationMessage.Action == WSFederationConstants.Actions.SignIn )
	{

			// Process the sign in request federationMessage
		}

}
}
/// <summary>
/// Returns whether the user is authenticated or not. 
/// </summary>
bool IsAuthenticatedUser
{
get
	{
return ( ( Page.User != null ) && ( Page.User.Identity != null ) && ( Page.User.Identity.IsAuthenticated ) );
}
}

Remarks

WSFederationMessage represents either a WS-Federation request, or a WS-Federation response. Both Microsoft.IdentityModel.Protocols.WSFederation.SignInRequestMessage and Microsoft.IdentityModel.Protocols.WSFederation.SignInResponseMessage derive from WSFderationMessage.


Inheritance Hierarchy

System.Object
  Microsoft.IdentityModel.Protocols.WSFederation.WSFederationMessage
     Derived Classes

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

See Also