io.vertx.ext.auth.jwt

## Class JWTOptions

- java.lang.Object
- - io.vertx.ext.auth.jwt.JWTOptions

-     public class JWTOptions
      extends Object

  Options related to creation of new tokens. If any expiresInMinutes, audience, subject, issuer are not provided, there is no default. The jwt generated won't include those properties in the payload. Generated JWTs will include an iat claim by default unless noTimestamp is specified.
  Author:
    Paulo Lopes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JWTOptions()`
    `JWTOptions(JsonObject json)`
    `JWTOptions(JWTOptions options)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JWTOptions` | `addAudience(String audience)` The target audience of this token
    `JWTOptions` | `addHeader(String name, String value)`
    `JWTOptions` | `addPermission(String permission)` Add a permission to this token.
    `String` | `getAlgorithm()`
    `List<String>` | `getAudience()`
    `Long` | `getExpiresInMinutes()`
    `Long` | `getExpiresInSeconds()`
    `JsonObject` | `getHeader()`
    `String` | `getIssuer()`
    `boolean` | `getNoTimestamp()`
    `String` | `getSubject()`
    `JWTOptions` | `setAlgorithm(String algorithm)` The algorithm to use, it should be one of the alias [HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512]
    `JWTOptions` | `setAudience(List<String> audience)` The target audience of this token
    `JWTOptions` | `setExpiresInMinutes(Long expiresInMinutes)` The expiration time for the token in minutes
    `JWTOptions` | `setExpiresInSeconds(Long expiresInSeconds)` The expiration time for the token in seconds
    `JWTOptions` | `setIssuer(String issuer)` The issuer of this token
    `JWTOptions` | `setNoTimestamp(boolean noTimestamp)` Disable the generation of issued at claim
    `JWTOptions` | `setPermissions(List<String> permissions)` The permissions of this token.
    `JWTOptions` | `setSubject(String subject)` The subject of this token
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JWTOptions

          public JWTOptions()

    - #### JWTOptions

          public JWTOptions(JsonObject json)

    - #### JWTOptions

          public JWTOptions(JWTOptions options)

  - ### Method Detail

    - #### getAlgorithm

          public String getAlgorithm()

    - #### setAlgorithm

          public JWTOptions setAlgorithm(String algorithm)

      The algorithm to use, it should be one of the alias [HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512]
      Parameters:
        `algorithm` - alias to keystore MAC/Certificate
      Returns:
        fluent API

    - #### getExpiresInMinutes

          public Long getExpiresInMinutes()

    - #### setExpiresInMinutes

          public JWTOptions setExpiresInMinutes(Long expiresInMinutes)

      The expiration time for the token in minutes
      Parameters:
        `expiresInMinutes` - time in minutes
      Returns:
        fluent API

    - #### getExpiresInSeconds

          public Long getExpiresInSeconds()

    - #### setExpiresInSeconds

          public JWTOptions setExpiresInSeconds(Long expiresInSeconds)

      The expiration time for the token in seconds
      Parameters:
        `expiresInSeconds` - time in seconds
      Returns:
        fluent API

    - #### getAudience

          public List<String> getAudience()

    - #### setAudience

          public JWTOptions setAudience(List<String> audience)

      The target audience of this token
      Parameters:
        `audience` - the audience for this token
      Returns:
        fluent API

    - #### addAudience

          public JWTOptions addAudience(String audience)

      The target audience of this token
      Parameters:
        `audience` - the audience for this token
      Returns:
        fluent API

    - #### getSubject

          public String getSubject()

    - #### setSubject

          public JWTOptions setSubject(String subject)

      The subject of this token
      Parameters:
        `subject` - the subject for this token
      Returns:
        fluent API

    - #### getIssuer

          public String getIssuer()

    - #### setIssuer

          public JWTOptions setIssuer(String issuer)

      The issuer of this token
      Parameters:
        `issuer` - the subject for this token
      Returns:
        fluent API

    - #### getNoTimestamp

          public boolean getNoTimestamp()

    - #### setNoTimestamp

          public JWTOptions setNoTimestamp(boolean noTimestamp)

      Disable the generation of issued at claim
      Parameters:
        `noTimestamp` - flag to control iat claim
      Returns:
        fluent API

    - #### getHeader

          public JsonObject getHeader()

    - #### addHeader

          public JWTOptions addHeader(String name,
                                      String value)

    - #### setPermissions

          public JWTOptions setPermissions(List<String> permissions)

      The permissions of this token.
      Parameters:
        `permissions` - the permissions for this token that will be used for AuthZ
      Returns:
        fluent API

    - #### addPermission

          public JWTOptions addPermission(String permission)

      Add a permission to this token.
      Parameters:
        `permission` - permission for this token that will be used for AuthZ
      Returns:
        fluent API

    - #### toJson

          public JsonObject toJson()

Copyright © 2017. All rights reserved.