SignInRequestMessage 类

定义

表示 WS-Federation Sign-In 请求消息。Represents a WS-Federation Sign-In Request message.

public ref class SignInRequestMessage : System::IdentityModel::Services::WSFederationMessage
public class SignInRequestMessage : System.IdentityModel.Services.WSFederationMessage
type SignInRequestMessage = class
    inherit WSFederationMessage
Public Class SignInRequestMessage
Inherits WSFederationMessage
继承

示例

string identityProviderUri = Request.QueryString["whr"];
string action = Request.QueryString["wa"];

SignInRequestMessage signInRequest = FederatedAuthentication.WSFederationAuthenticationModule.CreateSignInRequest(Guid.NewGuid().ToString(), 
                                                                                                                  "http://MyAppreturnUrl", 
                                                                                                                  false);
signInRequest.Realm = "htp://MyApp.com";
signInRequest.HomeRealm = identityProviderUri;

Response.Redirect(signInRequest.RequestUrl);

注解

WS-Federation 登录消息由依赖方 (RP) 发送到 security token service (STS) 来请求安全令牌。A WS-Federation sign-in message is sent by a relying party (RP) to a security token service (STS) to request a security token. Wa 参数必须设置为 "wsignout1.0 1.0",并且应将 wtrealm 参数设置为请求的资源的安全领域 (这通常是所请求资源) 的 URL。The wa parameter must be set to "wsignout1.0" and the wtrealm parameter should be set to the security realm of the requested resource (this is often the URL of the requested resource). 还可以在请求中指定其他可选参数。Other optional parameters may also be specified in the request.

SignOutRequestMessage消息是通过类的静态方法创建的 SignOutRequestMessage ,例如 CreateFromUri 方法,当 wa 参数设置为 "wsignin1.0 1.0" 时,不存在 wresult 或 wresultptr 参数,并且 wtrealm 参数或 wreply 参数存在。A SignOutRequestMessage message is created by the static methods of the SignOutRequestMessage class, for example the CreateFromUri method, when the wa parameter is set to "wsignin1.0", there is no wresult or wresultptr parameter present, and either a wtrealm parameter or a wreply parameter is present.

重要

为了与 Active Directory 联合身份验证服务 (AD FS) 版本1.0 的向后兼容,Windows Identity Foundation (WIF) 允许将 wtrealm 参数或 wreply 参数设置 (或同时) 两个,以便登录消息有效;但 WS-Federation 协议要求在登录请求中存在 wtrealm 参数。For backward compatibility with Active Directory Federation Services (AD FS) version 1.0, Windows Identity Foundation (WIF) allows either the wtrealm parameter or the wreply parameter to be set (or both) for a sign-in message to be valid; however, the WS-Federation protocol requires that the wtrealm parameter be present in a sign-in request. 在大多数情况下,应确保指定了 wtrealm 参数。In most scenarios, you should ensure that the wtrealm parameter is specified.

SignInRequestMessage类公开几个可用于设置或访问单个消息参数的属性。The SignInRequestMessage class exposes several properties that can be used to set or access individual message parameters. 还可以通过字典设置或访问这些参数 ParametersThese parameters can also be set or accessed through the Parameters dictionary. 例如,可以通过 Realm 属性或通过将 "wtrealm" 指定为字典的键来读取消息中的 wtrealm 参数 ParametersFor example, you can read the wtrealm parameter in the message either through the Realm property or by specifying "wtrealm" as the key to the Parameters dictionary.

有关此类表示的消息的详细信息,请参阅以下规范的第13节: Web Services 联合身份验证 Language (WS 联合身份验证) 1.2 版For more information about the message that this class represents, see section 13 of the following specification: Web Services Federation Language (WS-Federation) Version 1.2.

构造函数

SignInRequestMessage(Uri, String)

使用指定的基础 URL 和参数初始化 SignInRequestMessage 类的新实例。Initializes a new instance of the SignInRequestMessage class with the specified base URL and wtrealm parameter.

SignInRequestMessage(Uri, String, String)

使用指定的基础 URI、 wtrealm 和 wreply 参数初始化 SignInRequestMessage 类的新实例。Initializes a new instance of the SignInRequestMessage class using the specified base URI, wtrealm parameter, and wreply parameter. 支持向后兼容性的非标准消息创建。Supports non-standard message creation for backward compatibility.

属性

Action

获取或设置消息的 wa 参数。Gets or sets the wa parameter of the message.

(继承自 WSFederationMessage)
AuthenticationType

获取或设置消息的 wauth 参数。Gets or sets the wauth parameter of the message.

BaseUri

获取或设置消息要应用于的基 URI。Gets or sets the base URL to which the message applies.

(继承自 FederationMessage)
Context

获取或设置消息的 wctx 参数。Gets or sets the wctx parameter of the message.

(继承自 WSFederationMessage)
CurrentTime

获取或设置消息的 wct 参数。Gets or sets the wct parameter of the message.

Encoding

获取或设置消息的 wencoding 参数。Gets or sets the wencoding parameter of the message.

(继承自 WSFederationMessage)
Federation

获取或设置消息的 wfed 参数。Gets or sets the wfed parameter of the message.

Freshness

获取或设置消息的 wfresh 参数。Gets or sets the wfresh parameter of the message.

HomeRealm

获取或设置消息的 whr 参数。Gets or sets the whr parameter of the message.

Parameters

以字典形式获取消息参数。Gets the message parameters as a dictionary.

(继承自 FederationMessage)
Policy

获取或设置消息的 wp 参数。Gets or sets the wp parameter of the message.

Realm

获取或设置消息的 wtrealm 参数。Gets or sets the wtrealm parameter of the message.

Reply

获取或设置消息的 wreply 参数。Gets or sets the wreply parameter of the message.

Request

获取或设置消息的 wreq 参数。Gets or sets the wreq parameter of the message.

RequestPtr

获取或设置消息的 wreqptr 参数。Gets or sets the wreqptr parameter of the message.

RequestUrl

获取对应此消息的 URL 的字符串表示形式。Gets a string representation of the URL that corresponds to this message.

Resource

获取或设置消息的 wres 参数。Gets or sets the wres parameter of the message.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetParameter(String)

从参数字典中返回指定的参数值。Returns the specified parameter value from the parameters dictionary.

(继承自 FederationMessage)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
RemoveParameter(String)

从参数字典中移除参数。Removes a parameter from the parameters dictionary.

(继承自 FederationMessage)
SetParameter(String, String)

设置参数字典中参数的值。Sets the value of a parameter in the parameters dictionary.

(继承自 FederationMessage)
SetUriParameter(String, String)

设置参数字典中参数的值。Sets the value of a parameter in the parameters dictionary. 该值必须为绝对 URI。The value must be an absolute URI.

(继承自 FederationMessage)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Validate()

验证当前实例。Validates the current instance.

Write(TextWriter)

以查询字符串形式将此消息写入指定的文本写入器。Writes this message in query string form to the specified text writer.

WriteFormPost()

序列化一则消息作为窗体,发布并返回结果窗体和其以字符串形式的JavascriptSerializes the message as a form post and returns the resulting Form together with its Javascript as a string.

(继承自 FederationMessage)
WriteQueryString()

返回以查询字符串形式的消息的字符串表示形式。Returns a string representation of the message in query-string format.

(继承自 FederationMessage)

适用于

另请参阅