com.holonplatform.auth.jwt

## Interface JwtConfiguration

- All Superinterfaces:
    Serializable

      public interface JwtConfiguration
      extends Serializable

  JWT generation/authentication configuration attributes.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `JwtConfiguration.Builder` Builder to create `JwtConfiguration` instances.
    `static class` | `JwtConfiguration.InvalidJwtConfigurationException` Exception for `JwtConfiguration` errors.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONTEXT_KEY` Default `Context` resource reference

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JwtConfiguration` | `build(JwtConfigProperties properties)` Build a `JwtConfiguration` instance using given configuration `properties`.
    `static JwtConfiguration.Builder` | `builder()` Builder to create a `JwtConfiguration`
    `static Optional<JwtConfiguration>` | `getCurrent()` Convenience method to obtain the current `JwtConfiguration` made available as `Context` resource, using default `ClassLoader`.
    `long` | `getExpireTime()` JWT token expire time
    `String` | `getIssuer()` JWT token issuer (iss)
    `Key` | `getPrivateKey()` JWT signing private key for signature algorithms such as RSA
    `Key` | `getPublicKey()` JWT signing public key for signature algorithms such as RSA
    `byte[]` | `getSharedKey()` JWT signing shared key for signature algorithms such as HMAC
    `String` | `getSignatureAlgorithm()` JWT token signature algorithm
    `boolean` | `isIncludeDetails()` Whether to include `Authentication` details in JWT token at generation time
    `boolean` | `isIncludePermissions()` Whether to include `Authentication` permissions in JWT token at generation time

- - ### Field Detail

    - #### CONTEXT_KEY

          static final String CONTEXT_KEY

      Default `Context` resource reference

  - ### Method Detail

    - #### getIssuer

          String getIssuer()

      JWT token issuer (iss)
      Returns:
        Issuer

    - #### getSignatureAlgorithm

          String getSignatureAlgorithm()

      JWT token signature algorithm
      Returns:
        Signature algorithm name

    - #### getSharedKey

          byte[] getSharedKey()

      JWT signing shared key for signature algorithms such as HMAC
      Returns:
        JWT signing shared key

    - #### getPublicKey

          Key getPublicKey()

      JWT signing public key for signature algorithms such as RSA
      Returns:
        JWT signing public key

    - #### getPrivateKey

          Key getPrivateKey()

      JWT signing private key for signature algorithms such as RSA
      Returns:
        JWT signing private key

    - #### getExpireTime

          long getExpireTime()

      JWT token expire time
      Returns:
        Expire time in milliseconds. `<=0` means token never expires

    - #### isIncludeDetails

          boolean isIncludeDetails()

      Whether to include `Authentication` details in JWT token at generation time
      Returns:
        `true` to include `Authentication` details in JWT token

    - #### isIncludePermissions

          boolean isIncludePermissions()

      Whether to include `Authentication` permissions in JWT token at generation time
      Returns:
        `true` to include `Authentication` permissions in JWT token

    - #### getCurrent

          static Optional<JwtConfiguration> getCurrent()

      Convenience method to obtain the current `JwtConfiguration` made available as `Context` resource, using default `ClassLoader`.

      See `Context.resource(String, Class)` for details about context resources availability conditions.

      Returns:
        Optional JwtConfiguration, empty if not available as context resource

    - #### builder

          static JwtConfiguration.Builder builder()

      Builder to create a `JwtConfiguration`
      Returns:
        JwtConfiguration builder

    - #### build

          static JwtConfiguration build(JwtConfigProperties properties)
                                 throws JwtConfiguration.InvalidJwtConfigurationException

      Build a `JwtConfiguration` instance using given configuration `properties`.
      Parameters:
        `properties` - JWT configuration property source
      Returns:
        JwtConfiguration
      Throws:
        `JwtConfiguration.InvalidJwtConfigurationException` - Error building configuration

Copyright © 2017 The Holon Platform. All rights reserved.