com.holonplatform.auth.jwt

## Interface JwtTokenParser

- All Known Implementing Classes:
    DefaultJwtTokenParser

      public interface JwtTokenParser

  A parser to parse a JWT and obtain it as an `Authentication` instance.
  Since:
    5.1.1

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JwtTokenParser` | `get()` Get the default `JwtTokenParser`.
    `Authentication.Builder` | `parseJwt(JwtConfiguration configuration, String jwt)` Parse given JWT and obtain it as an `Authentication` instance.

- - ### Method Detail

    - #### parseJwt

          Authentication.Builder parseJwt(JwtConfiguration configuration,
                                          String jwt)
                                   throws JwtConfiguration.InvalidJwtConfigurationException,
                                          AuthenticationException

      Parse given JWT and obtain it as an `Authentication` instance.

      If the `JwtConfiguration.isIncludeDetails()` switch is `true`, the JWT claims will be included in the `Authentication` instance parameter set, using the claim name as detail key.

      If the `JwtConfiguration.isIncludePermissions()` switch is `true`, the default JWT claim named `AuthenticationClaims.CLAIM_NAME_PERMISSIONS`, if present, is parsed to obtain the the authentication permissions.

      Parameters:
        `configuration` - JWT configuration to use (not null)
        `jwt` - JWT value (not null)
      Returns:
        The `Authentication` instance which represents the JWT value, if the token is valid.
      Throws:
        `JwtConfiguration.InvalidJwtConfigurationException` - If the JWT confguration is not valid
        `AuthenticationException` - If the JWT token validation fails

    - #### get

          static JwtTokenParser get()

      Get the default `JwtTokenParser`.
      Returns:
        The default `JwtTokenParser`.

Copyright © 2019 The Holon Platform. All rights reserved.