Class StatelessJwtAssertionTokenSource
- Namespace
- Line.OpenApi.ChannelAccessToken
- Assembly
- Line.OpenApi.ChannelAccessToken.dll
An IChannelAccessTokenSource implementation that consumes the generated
client (Line.OpenApi.ChannelAccessToken.Generated.ChannelAccessTokenClient) and issues a stateless channel
access token (/oauth2/v3/token) via a JWT assertion.
A stateless token has no limit on the number of concurrently active tokens, but in exchange it lives for only 15 minutes and cannot be revoked before expiry. Because it is short-lived, the intended usage is to combine it with RefreshingChannelAccessTokenProvider and issue one on demand.
R2 usability: the body of /oauth2/v3/token is a discriminator-less oneOf, which in
the generated code shows up as the composed wrapper
TokenRequestBuilder.TokenPostRequestBody (an IComposedTypeWrapper). That
wrapper serializes the inner request model as a nested object, so sending it as-is
over form-urlencoded (whose Kiota Form serializer does not support nesting) fails with
"Form serialization does not support nested objects." This class avoids the
composed wrapper and instead sends the flat request model
Line.OpenApi.ChannelAccessToken.Generated.Models.IssueStatelessChannelTokenByJWTAssertionRequest directly as the body,
hiding this pitfall and offering the same issuance seam as
JwtAssertionTokenSource (/oauth2/v2.1/token).
Producing the JWT assertion itself (signing with the channel's private key) is application-specific, so the caller supplies it through assertionFactory (this library never handles signing keys).
public sealed class StatelessJwtAssertionTokenSource : IChannelAccessTokenSource
- Inheritance
-
StatelessJwtAssertionTokenSource
- Implements
- Inherited Members
Methods
IssueAsync(CancellationToken)
Issues a single token.
public Task<IssuedToken> IssueAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken