Skip to main content

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

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