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.

  • Method Details

    • equals

      public boolean equals(Object rhs)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • withToken

      @NonNull public static AuthenticationMode withToken(@NonNull String accessToken)

      SDK will pass access token as a Bearer.

      Parameters:
      accessToken -

      Access token

      Returns:

      Instance of AuthenticationMode configured 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 AuthenticationMode configured to use token provider

    • withExternal

      @NonNull public static AuthenticationMode withExternal()

      Assumes the authentication is provided by the client.

      Returns:

      Instance of AuthenticationMode configured 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 AuthenticationMode configured to use key ID and secret