Redigera

Dela via


SecurityTokenService.GetTokenLifetime(Lifetime) Method

Definition

Gets the lifetime for the issued token.

protected:
 virtual System::IdentityModel::Protocols::WSTrust::Lifetime ^ GetTokenLifetime(System::IdentityModel::Protocols::WSTrust::Lifetime ^ requestLifetime);
protected virtual System.IdentityModel.Protocols.WSTrust.Lifetime GetTokenLifetime (System.IdentityModel.Protocols.WSTrust.Lifetime requestLifetime);
abstract member GetTokenLifetime : System.IdentityModel.Protocols.WSTrust.Lifetime -> System.IdentityModel.Protocols.WSTrust.Lifetime
override this.GetTokenLifetime : System.IdentityModel.Protocols.WSTrust.Lifetime -> System.IdentityModel.Protocols.WSTrust.Lifetime
Protected Overridable Function GetTokenLifetime (requestLifetime As Lifetime) As Lifetime

Parameters

requestLifetime
Lifetime

A Lifetime that represents the requested lifetime.

Returns

A Lifetime that represents the granted lifetime.

Remarks

This method is normally called with the lifetime that arrived in the RST. In the default implementation, the token lifetime is calculated according to the following table.

Created (in) Expires (in) Created (in) Expires (out)
null null DateTime.UtcNow DateTime.UtcNow + SecurityTokenServiceConfiguration.DefaultTokenLifetime
C null C C + SecurityTokenServiceConfiguration.DefaultTokenLifetime
null E DateTime.UtcNow E
C E C E

This method is called from the default token issuance pipeline implemented in the Issue method.

Applies to

See also