WSFederationMessage 类

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

命名空间: Microsoft.IdentityModel.Protocols.WSFederation
程序集: Microsoft.IdentityModel(microsoft.identitymodel.dll 中)

用法

    Dim instance As WSFederationMessage

语法

声明
Public MustInherit Class WSFederationMessage
public abstract class WSFederationMessage
public ref class WSFederationMessage abstract
public abstract class WSFederationMessage
public abstract class WSFederationMessage

示例

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

备注

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.

继承层次结构

System.Object
  Microsoft.IdentityModel.Protocols.WSFederation.WSFederationMessage
     派生类

线程安全

此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不能保证任何实例成员是线程安全的。

平台

开发平台

Windows Server 2003, Windows Vista

Target Platforms

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

Change History

请参见

参考

WSFederationMessage 成员
Microsoft.IdentityModel.Protocols.WSFederation 命名空间