IAuthenticatorClient
Namespace: Meshmakers.Octo.Sdk.ServiceClient.Authentication
Interface for the authenticator client.
public interface IAuthenticatorClient : IAuthorizationClient
Implements IAuthorizationClient
Methods
EnsureAuthenticatedAsync(String, String)
Ensures that the user is authenticated, if not it will try to refresh the token.
Task<EnsureAuthenticatedData> EnsureAuthenticatedAsync(string refreshToken, string accessToken)
Parameters
refreshToken String
The refresh token.
accessToken String
The current access token
Returns
Task<EnsureAuthenticatedData>
Authentication data received by the identity provider
RequestDeviceAuthorizationAsync(ApiScopes, IEnumerable<String>)
Requests authentication using device authorization.
Task<DeviceAuthenticationRequestData> RequestDeviceAuthorizationAsync(ApiScopes apiScopes, IEnumerable<string> customScopes)
Parameters
apiScopes ApiScopes
The requested api scopes
customScopes IEnumerable<String>
Optional additional custom scopes to be added to auth token
Returns
Task<DeviceAuthenticationRequestData>
RequestDeviceTokenAsync(String)
Requests authentication using a device code received by IAuthenticatorClient.RequestDeviceAuthorizationAsync(ApiScopes, IEnumerable<String>)
Task<DeviceAuthenticationData> RequestDeviceTokenAsync(string deviceCode)
Parameters
deviceCode String
The device code
Returns
Task<DeviceAuthenticationData>
Authentication data received by the identity provider
RequestClientCredentialsTokenAsync(ApiScopes, DefaultScopes, IEnumerable<String>, String, String)
Requests authentication using client credentials.
Task<AuthenticationData> RequestClientCredentialsTokenAsync(ApiScopes apiScopes, DefaultScopes defaultScopes, IEnumerable<string> customScopes, string clientId, string clientSecret)
Parameters
apiScopes ApiScopes
The requested api scopes
defaultScopes DefaultScopes
The requested default scopes
customScopes IEnumerable<String>
Optional additional custom scopes to be added to auth token
clientId String
Optional client id override. Falls back to the configured AuthenticatorOptions.ClientId when null.
clientSecret String
Optional client secret override. Falls back to the configured AuthenticatorOptions.ClientSecret when null.
Returns
Task<AuthenticationData>
Authentication data received by the identity provider
RequestClientCredentialsTokenForTenantAsync(String, ApiScopes, DefaultScopes, String, String)
Requests a client-credentials token for a named tenant (acr_values=tenant:{tenantId}) with the given
credentials, regardless of the tenant the client is configured for. The caller needs it to act in a
child tenant as the mirror of its own client: a token of the parent tenant is refused on a child's routes.
Task<AuthenticationData> RequestClientCredentialsTokenForTenantAsync(string tenantId, ApiScopes apiScopes, DefaultScopes defaultScopes, string clientId, string clientSecret)
Parameters
tenantId String
The tenant the token is issued for.
apiScopes ApiScopes
The requested api scopes
defaultScopes DefaultScopes
The requested default scopes
clientId String
Client id (the mirror of a client has the id of its parent client).
clientSecret String
The client's secret in that tenant.
Returns
Task<AuthenticationData>
Authentication data received by the identity provider
RequestPasswordTokenAsync(String, String, ApiScopes, IEnumerable<String>)
Requests authentication using password and username.
Task<AuthenticationData> RequestPasswordTokenAsync(string username, string password, ApiScopes apiScopes, IEnumerable<string> customScopes)
Parameters
username String
The Username
password String
The password
apiScopes ApiScopes
The requested api scopes
customScopes IEnumerable<String>
Optional additional custom scopes to be added to auth token
Returns
Task<AuthenticationData>
Authentication data received by the identity provider
RefreshTokenAsync(String)
Refreshes the token.
Task<AuthenticationData> RefreshTokenAsync(string refreshToken)
Parameters
refreshToken String
The refresh token.
Returns
Task<AuthenticationData>
Authentication data received by the identity provider