Class OAuthAccessToken
An OAuth2 bearer access token issued by POST /oauth/token.
public sealed record OAuthAccessToken : IOAuthAccessToken
- Inheritance
-
objectOAuthAccessToken
- Implements
Constructors
OAuthAccessToken(string, string, int, string?, string?, string?)
An OAuth2 bearer access token issued by POST /oauth/token.
public OAuthAccessToken(string AccessToken, string TokenType, int ExpiresIn, string? Scope = null, string? RefreshToken = null, string? IdToken = null)
Parameters
AccessTokenstringThe access token, a JWT, sent as
Authorization: Bearer <token>on every other route. The login methods of OpenBiApiClientAuthExtensions attach it to the client already.TokenTypestringThe token type, always
Bearer.ExpiresInintHow long the token is valid, in seconds from when it was issued.
ScopestringWhat the token may do: the permission ids it was granted, space delimited, as
openbi.<resource>.<read|write|delete>- the same ids the routes check. Null from a server older than 2026-09-24, which did not return it.RefreshTokenstringWhat RefreshAccessTokenAsync(IOpenBiApiClient, string, string?, string?, string?, CancellationToken) takes for the next access token - returned by the
password,negotiate,authorization_codeandrefresh_tokengrants, null forclient_credentials, whose api key can simply ask again. Every use replaces it; keep the new one, because the old one used again revokes the grant.IdTokenstringOpenID Connect: who the user is, as a signed JWT for the app (
audis its client id) - returned by theauthorization_codeandrefresh_tokengrants of an app that asked for theopenidscope, null otherwise.
Properties
AccessToken
The access token, a JWT, sent as Authorization: Bearer <token> on every other route. The login
methods of OpenBiApiClientAuthExtensions attach it to the client already.
[JsonPropertyName("access_token")]
public string AccessToken { get; init; }
Property Value
- string
ExpiresIn
How long the token is valid, in seconds from when it was issued.
[JsonPropertyName("expires_in")]
public int ExpiresIn { get; init; }
Property Value
- int
IdToken
OpenID Connect: who the user is, as a signed JWT for the app (aud is its client id) - returned by the
authorization_code and refresh_token grants of an app that asked for the openid scope,
null otherwise.
[JsonPropertyName("id_token")]
public string? IdToken { get; init; }
Property Value
- string
RefreshToken
What RefreshAccessTokenAsync(IOpenBiApiClient, string, string?, string?, string?, CancellationToken) takes for the next access token -
returned by the password, negotiate, authorization_code and refresh_token
grants, null for client_credentials, whose api key can simply ask again.
Every use replaces it; keep the new one, because the old one used again revokes the grant.
[JsonPropertyName("refresh_token")]
public string? RefreshToken { get; init; }
Property Value
- string
Scope
What the token may do: the permission ids it was granted, space delimited, as
openbi.<resource>.<read|write|delete> - the same ids the routes check. Null from a
server older than 2026-09-24, which did not return it.
[JsonPropertyName("scope")]
public string? Scope { get; init; }
Property Value
- string
TokenType
The token type, always Bearer.
[JsonPropertyName("token_type")]
public string TokenType { get; init; }
Property Value
- string