Class ServiceAuthenticationAdminApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Admin.ServiceAuthentication
Assembly: Unity.Services.Apis.dll
Syntax
public class ServiceAuthenticationAdminApi : IServiceAuthenticationAdminApi, IApiAccessor
Constructors
ServiceAuthenticationAdminApi(IApiClient)
Initializes a new instance of the Service
Declaration
public ServiceAuthenticationAdminApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
ServiceAuthenticationAdminApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Service
Declaration
public ServiceAuthenticationAdminApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
IApi |
apiConfiguration | The configuration object. |
Properties
Client
The client for accessing this underlying API asynchronously.
Declaration
public IApiClient Client { get; }
Property Value
Type | Description |
---|---|
IApi |
Configuration
Gets the configuration object
Declaration
public IApiConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
IApi |
An instance of the Configuration |
Methods
ExchangeToStateless(string, string, ExchangeRequest, CancellationToken)
Token Exchange API Exchange a Service Account Key ID and Secret Key pair to a Stateless Access Token. The access token is always scoped to a project and optionally even to an environment. Following the principle of least privilege it is a good practice to scope the token to both project and environment ID if applicable. <br/><br/> The request can optionally contain a list of permissions that should be scoped to the access token. If left out then all scopes will be included by default. <br/><br/> The returned access token is a standard RFC 7519 JWT and has a 1 hour expiration time (TTL). <br /><br /> The Token Exchange API has a maximum limit of 100 permissions that can be included in the Stateless Access Token. Because all permissions are included by default this cap can be hit when no scopes
are being specified in the request. This might happen if the Service Account has been assigned multiple roles that each grant their own permissions. If the permission cap is reached the API will return an error. In this case it's required to specify the exact permissions that the Stateless Access Token should have when using the exchange API.
Declaration
public ApiOperation<ExchangeResponse> ExchangeToStateless(string projectId, string environmentId = null, ExchangeRequest exchangeRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID for Unity project that the access token is scoped to. |
string | environmentId | Id of an environment that the access token is scoped to. (optional) |
Exchange |
exchangeRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |