JWT Access Token (IJwtAccessTokenService) Interface
Namespace: CXT.IO.Dashboard.Api.ServicesSource File: IJwtAccessTokenService.cs
Defines the contract for services responsible for acquiring JWT (JSON Web Token) access tokens.
Purpose
- To abstract the mechanism of token acquisition, making it easier to mock for testing or replace the implementation.
- To provide a simple, standardized way for other services to obtain bearer tokens for authenticating server-to-server calls to downstream APIs.
Methods
Token async
csharp
Task<string> TokenAsync(IEnumerable<string> scopes);- Description: Asynchronously acquires an access token for the application.
- Parameters:
Parameter Type Description scopesIEnumerable<string>The permissions (scopes) being requested for the token. These define the target downstream API and the level of access (e.g., api://<app-id>/.default). - Returns:
Task<string>- The formatted access token (e.g., "Bearer eyJhbGciOi...").
Consumers and Implementers
- Consumer:
AccountSettingsV2Service - Implementer:
JwtAccessTokenService