Class 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 Detail

      • equals

        public boolean equals​(java.lang.Object rhs)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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 AuthenticationMode configured to use token

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