Table of Contents

Class OAuthAccessToken

Namespace
BiExcellence.OpenBi.Api.Auth
Assembly
BiExcellence.OpenBi.Api.Client.dll

An OAuth2 bearer access token issued by POST /oauth/token.

public sealed record OAuthAccessToken : IOAuthAccessToken
Inheritance
object
OAuthAccessToken
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

AccessToken string

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.

TokenType string

The token type, always Bearer.

ExpiresIn int

How long the token is valid, in seconds from when it was issued.

Scope string

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.

RefreshToken string

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.

IdToken string

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.

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