com.holonplatform.auth

## Interface AuthenticationToken.AuthenticationTokenResolver<R extends Message>

- Type Parameters:
    `R` - Concrete authentication request message
  Enclosing interface:
    AuthenticationToken

      public static interface AuthenticationToken.AuthenticationTokenResolver<R extends Message>

  Resolver to obtain an `AuthenticationToken` from an authentication request using a generic `Message`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <M extends Message> AuthenticationToken.AuthenticationTokenResolver<M>` | `create(Class<? extends Message> messageType, Function<M,Optional<AuthenticationToken>> resolverFunction)` Create a new `AuthenticationToken.AuthenticationTokenResolver` for given `messageType`, providing the resolution function to obtain an `AuthenticationToken` from a message instance.
    `static <M extends Message> AuthenticationToken.AuthenticationTokenResolver<M>` | `create(Class<? extends Message> messageType, Function<M,Optional<AuthenticationToken>> resolverFunction, String scheme)` Create a new `AuthenticationToken.AuthenticationTokenResolver` for given `messageType`, providing the resolution function to obtain an `AuthenticationToken` from a message instance.
    `Optional<AuthenticationToken>` | `getAuthenticationToken(R request)` Parse given `request` message and try to obtain an `AuthenticationToken` if request is eligible for this resolver authentication mechanism.
    `Class<? extends Message>` | `getMessageType()` Get supported message type
    `Optional<String>` | `getScheme()` Optional authentication scheme

- - ### Method Detail

    - #### getMessageType

          Class<? extends Message> getMessageType()

      Get supported message type
      Returns:
        Message type

    - #### getScheme

          Optional<String> getScheme()

      Optional authentication scheme
      Returns:
        Authentication scheme name, empty if not available

    - #### getAuthenticationToken

          Optional<AuthenticationToken> getAuthenticationToken(R request)
                                                        throws AuthenticationException

      Parse given `request` message and try to obtain an `AuthenticationToken` if request is eligible for this resolver authentication mechanism.
      Parameters:
        `request` - Authentication request
      Returns:
        AuthenticationToken, or an empty Optional if request is not eligible for this resolver authentication mechanism
      Throws:
        `AuthenticationException` - Id resolver recognized given request but it is somehow malformed or incomplete

    - #### create

          static <M extends Message> AuthenticationToken.AuthenticationTokenResolver<M> create(Class<? extends Message> messageType,
                                                                                               Function<M,Optional<AuthenticationToken>> resolverFunction)

      Create a new `AuthenticationToken.AuthenticationTokenResolver` for given `messageType`, providing the resolution function to obtain an `AuthenticationToken` from a message instance.
      Type Parameters:
        `M` - Message type
      Parameters:
        `messageType` - Message type to resolve (not null)
        `resolverFunction` - Resolution function (not null)
      Returns:
        A new `AuthenticationToken.AuthenticationTokenResolver` instance

    - #### create

          static <M extends Message> AuthenticationToken.AuthenticationTokenResolver<M> create(Class<? extends Message> messageType,
                                                                                               Function<M,Optional<AuthenticationToken>> resolverFunction,
                                                                                               String scheme)

      Create a new `AuthenticationToken.AuthenticationTokenResolver` for given `messageType`, providing the resolution function to obtain an `AuthenticationToken` from a message instance.
      Type Parameters:
        `M` - Message type
      Parameters:
        `messageType` - Message type to resolve (not null)
        `resolverFunction` - Resolution function (not null)
        `scheme` - Authentication scheme to which the resolver is bound
      Returns:
        A new `AuthenticationToken.AuthenticationTokenResolver` instance

Copyright © 2019 The Holon Platform. All rights reserved.