com.holonplatform.auth.jwt

## Interface JwtTokenBuilder

-     public interface JwtTokenBuilder

  JWT builder using `Authentication` objects.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `JwtTokenBuilder.AuthPart` Enumeration of `Authentication` parts

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default String` | `buildJwt(JwtConfiguration configuration, Authentication authentication)` Build a JSON Web Token using given `JwtConfiguration` for given `Authentication`.
    `String` | `buildJwt(JwtConfiguration configuration, Authentication authentication, String jwtTokenId)` Build a JSON Web Token using given `JwtConfiguration` for given `Authentication`.
    `static String` | `buildJwtToken(JwtConfiguration configuration, Authentication authentication, String jwtTokenId)` Deprecated. Use `get()` to obtain the default `JwtTokenBuilder` on which to call the `buildJwt(JwtConfiguration, Authentication, String)` method
    `static JwtTokenBuilder` | `get()` Get the default `JwtTokenBuilder`.

- - ### Method Detail

    - #### buildJwt

          String buildJwt(JwtConfiguration configuration,
                          Authentication authentication,
                          String jwtTokenId)
                   throws JwtConfiguration.InvalidJwtConfigurationException

      Build a JSON Web Token using given `JwtConfiguration` for given `Authentication`.
      Parameters:
        `configuration` - JWT configuration (not null)
        `authentication` - Authentication for which to create the JWT (not null)
        `jwtTokenId` - JWT token id (jit claim)
      Returns:
        The JWT representation
      Throws:
        `JwtConfiguration.InvalidJwtConfigurationException` - Invalid JWT configuration

    - #### buildJwt

          default String buildJwt(JwtConfiguration configuration,
                                  Authentication authentication)
                           throws JwtConfiguration.InvalidJwtConfigurationException

      Build a JSON Web Token using given `JwtConfiguration` for given `Authentication`.
      Parameters:
        `configuration` - JWT configuration (not null)
        `authentication` - Authentication for which to create the JWT (not null)
      Returns:
        The JWT representation
      Throws:
        `JwtConfiguration.InvalidJwtConfigurationException` - Invalid JWT configuration

    - #### get

          static JwtTokenBuilder get()

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

    - #### buildJwtToken

          @Deprecated
          static String buildJwtToken(JwtConfiguration configuration,
                                                   Authentication authentication,
                                                   String jwtTokenId)
                                            throws JwtConfiguration.InvalidJwtConfigurationException

      Deprecated. Use `get()` to obtain the default `JwtTokenBuilder` on which to call the `buildJwt(JwtConfiguration, Authentication, String)` method
      Build a JWT token using given `JwtConfiguration` for given `Authentication`.
      Parameters:
        `configuration` - JWT configuration (not null)
        `authentication` - Authentication for which to create the token (not null)
        `jwtTokenId` - Optional JWT token id (jit claim)
      Returns:
        JWT token
      Throws:
        `JwtConfiguration.InvalidJwtConfigurationException` - Invalid JWT configuration

Copyright © 2019 The Holon Platform. All rights reserved.