SessionSecurityTokenHandler.ValidateSession(SessionSecurityToken) 方法

定义

确定与指定标记相关联的会话是否有效。Determines whether the session associated with the specified token is still valid. 通过检查指定标记的 ValidFromValidTo 确定有效性。Validity is determined by checking the ValidFrom and ValidTo properties of the specified token. 如果该会话不再有效,则引发异常。An exception is thrown if the session is no longer valid.

protected:
 virtual void ValidateSession(System::IdentityModel::Tokens::SessionSecurityToken ^ securityToken);
protected virtual void ValidateSession (System.IdentityModel.Tokens.SessionSecurityToken securityToken);
abstract member ValidateSession : System.IdentityModel.Tokens.SessionSecurityToken -> unit
override this.ValidateSession : System.IdentityModel.Tokens.SessionSecurityToken -> unit
Protected Overridable Sub ValidateSession (securityToken As SessionSecurityToken)

参数

securityToken
SessionSecurityToken

要检查的标记。The token to be checked.

例外

securityTokennullsecurityToken is null.

Configuration 属性为 nullThe Configuration property is null.

令牌的 ValidFrom 属性迟于 UtcNowThe ValidFrom property of the token is later than UtcNow.

该令牌的 ValidTo 属性早于 UtcNowThe ValidTo property of the token is earlier than UtcNow.

注解

如果标记的 ValidFrom 属性设置为晚于的值 UtcNow ,或者其 ValidTo 属性设置为早于的值,则该标记无效 UtcNowThe token is not valid if its ValidFrom property is set to a value that occurs later than UtcNow, or if its ValidTo property is set to a value that occurs earlier than UtcNow.

从方法调用 ValidateToken 以验证会话。Called from the ValidateToken methods to validate the session.

适用于