Class AuthenticationMode
Class AuthenticationMode
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.core.engine.AuthenticationMode
-
public final class AuthenticationMode extends NativeBase
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 Classes Modifier and Type Class Description static interfaceAuthenticationMode.AccessTokenProviderThis lambda is used to retrieve access token in synchronous manner.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object rhs)inthashCode()static AuthenticationModewithExternal()Assumes the authentication is provided by the client.static AuthenticationModewithKeySecret(java.lang.String accessKeyId, java.lang.String accessKeySecret)SDK will authenticate with access key id access key secret to obtain authentication token.static AuthenticationModewithToken(java.lang.String accessToken)SDK will pass access token as a Bearer.static AuthenticationModewithTokenProvider(AuthenticationMode.AccessTokenProvider tokenProvider)SDK will use access token provider to retrieve access token.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
withToken
@NonNull public static AuthenticationMode withToken(@NonNull java.lang.String accessToken)
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
@NonNull public static AuthenticationMode 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 java.lang.String accessKeyId, @NonNull java.lang.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
-
-