Partager via


Classe WSFederationMessage

Defines the base class from which all the Federation messages classes derive.

Espace de noms: Microsoft.IdentityModel.Protocols.WSFederation
Assembly : Microsoft.IdentityModel (dans microsoft.identitymodel.dll)

Utilisation

    Dim instance As WSFederationMessage

Syntaxe

'Déclaration
Public MustInherit Class WSFederationMessage
public abstract class WSFederationMessage
public ref class WSFederationMessage abstract
public abstract class WSFederationMessage
public abstract class WSFederationMessage

Exemple

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

 
/// <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 ) );
      }
}

Remarques

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.

Hiérarchie d'héritage

System.Object
  Microsoft.IdentityModel.Protocols.WSFederation.WSFederationMessage
     Classes dérivées

Cohérence de thread

Tous les membres statiques publics (partagés dans Visual Basic) de ce type sont thread-safe.Il n'est pas garanti que les membres d'instance soient thread-safe.

Plateformes

Plateformes de développement

Windows Server 2003, Windows Vista

Target Platforms

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

Change History

Voir aussi

Référence

Membres WSFederationMessage
Espace de noms Microsoft.IdentityModel.Protocols.WSFederation