AuthenticationMode (API Reference)
Class AuthenticationMode
This is a bearer authentication mode which adds or does not add a header ("Authorization", "Bearer $Token") to each online request of the module the object is added to. The token (if used) can be provided or is retrieved via key/secret from a dedicated backend.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis lambda is used to retrieve access token in synchronous manner. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static AuthenticationModeAssumes the authentication is provided by the client.static AuthenticationModewithKeySecret(String accessKeyId, String accessKeySecret) SDK will authenticate with access key id access key secret to obtain authentication token.static AuthenticationModeSDK will pass access token as a Bearer.static AuthenticationModewithTokenProvider(AuthenticationMode.AccessTokenProvider tokenProvider) SDK will use access token provider to retrieve access token.
-
Method Details
-
equals
-
hashCode
public int hashCode() -
withToken
SDK will pass access token as a Bearer.
- Parameters:
accessToken-Access token
- Returns:
Instance of
AuthenticationModeconfigured to use token
-
withTokenProvider
@NonNull public static AuthenticationMode withTokenProvider(@NonNull AuthenticationMode.AccessTokenProvider tokenProvider) SDK will use access token provider to retrieve access token.
- Parameters:
tokenProvider-Access token provider
- Returns:
Instance of
AuthenticationModeconfigured to use token provider
-
withExternal
Assumes the authentication is provided by the client.
- Returns:
Instance of
AuthenticationModeconfigured to use externally provided authentication
-
withKeySecret
@NonNull public static AuthenticationMode withKeySecret(@NonNull String accessKeyId, @NonNull String accessKeySecret) SDK will authenticate with access key id access key secret to obtain authentication token.
- Parameters:
accessKeyId-The access key id
accessKeySecret-The access key secret
- Returns:
Instance of
AuthenticationModeconfigured to use key ID and secret
-