SecurityTokenService.GetTokenLifetime Method (Lifetime)

.NET Framework (current version)
 

Gets the lifetime for the issued token.

Namespace:   System.IdentityModel
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

protected virtual Lifetime GetTokenLifetime(
	Lifetime requestLifetime
)

Parameters

requestLifetime
Type: System.IdentityModel.Protocols.WSTrust.Lifetime

A Lifetime that represents the requested lifetime.

Return Value

Type: System.IdentityModel.Protocols.WSTrust.Lifetime

A Lifetime that represents the granted lifetime.

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.

.NET Framework
Available since 4.5
Return to top
Show: