Click or drag to resize
IJwtTokenServiceIssueToken Method
Creates and serializes the JWT token.

Namespace: CMS.Base.Internal
Assembly: CMS.Base (in CMS.Base.dll) Version: 13.0.131
Syntax
C#
string IssueToken(
	string userName,
	DateTime validTo,
	IEnumerable<Claim> customClaims = null,
	Nullable<DateTime> validFrom = null
)

Parameters

userName
Type: SystemString
User name (the principal that is the subject of the JWT).
validTo
Type: SystemDateTime
Expiration date of the JWT token.
customClaims (Optional)
Type: System.Collections.GenericIEnumerableClaim
Custom JWT token claims
validFrom (Optional)
Type: SystemNullableDateTime
The valid-from date specifies the time the JWT token becomes effective.

Return Value

Type: String
Serialized the JWT token.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrows when userName is null.
ArgumentExceptionThrow when validTo is in the past.
See Also