io.vertx.ext.auth.oauth2

## Class OAuth2Options

- java.lang.Object
- - io.vertx.ext.auth.oauth2.OAuth2Options

-     public class OAuth2Options
      extends Object

  Options describing how an OAuth2 `HttpClient` will make connections.
  Author:
    Paulo Lopes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OAuth2Options()` Default constructor
    `OAuth2Options(JsonObject json)` Constructor to create an options from JSON
    `OAuth2Options(OAuth2Options other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `OAuth2Options` | `addPubSecKey(PubSecKeyOptions pubSecKey)`
    `OAuth2Options` | `addSupportedGrantType(String supportedGrantType)`
    `String` | `getAuthorizationPath()` Get the Oauth2 authorization resource path.
    `String` | `getClientAssertion()`
    `String` | `getClientAssertionType()`
    `String` | `getClientId()` Get the provider client id
    `String` | `getClientID()` Deprecated. see `getClientId()`
    `String` | `getClientSecret()` Get the provider client secret
    `JsonObject` | `getExtraParameters()` Extra parameters to send to the provider
    `OAuth2FlowType` | `getFlow()` Deprecated. see `Oauth2Credentials.getFlow()`
    `JsonObject` | `getHeaders()` Custom headers to send along with every request.
    `HttpClientOptions` | `getHttpClientOptions()`
    `String` | `getIntrospectionPath()` The provider token introspection resource path
    `long` | `getJwkMaxAgeInSeconds()`
    `String` | `getJwkPath()`
    `JWTOptions` | `getJWTOptions()`
    `String` | `getLogoutPath()` The provider logout path
    `List<PubSecKeyOptions>` | `getPubSecKeys()` The provider PubSec key options
    `String` | `getRevocationPath()` Get the Oauth2 revocation resource path.
    `String` | `getScopeSeparator()` Set the provider scope separator
    `String` | `getSite()`
    `List<String>` | `getSupportedGrantTypes()` The provider supported grant types
    `String` | `getTenant()`
    `String` | `getTokenPath()` Get the Oauth2 token resource path.
    `String` | `getUserAgent()` The User-Agent header to use when communicating with a provider
    `JsonObject` | `getUserInfoParameters()` Set the provider custom userInfo parameters to send when requesting them.
    `String` | `getUserInfoPath()` The provider userInfo resource path
    `boolean` | `isRotateJWKs()` Deprecated.
    `boolean` | `isValidateIssuer()`
    `void` | `replaceVariables(boolean strict)`
    `OAuth2Options` | `setAuthorizationPath(String authorizationPath)`
    `OAuth2Options` | `setClientAssertion(String clientAssertion)`
    `OAuth2Options` | `setClientAssertionType(String clientAssertionType)`
    `OAuth2Options` | `setClientId(String clientId)` Set the provider client id
    `OAuth2Options` | `setClientID(String clientID)` Deprecated. see `setClientId(String)`
    `OAuth2Options` | `setClientSecret(String clientSecret)` Set the provider client secret
    `OAuth2Options` | `setExtraParameters(JsonObject extraParams)` Set extra parameters to be sent to the provider on each request
    `OAuth2Options` | `setFlow(OAuth2FlowType flow)` Deprecated. see `Oauth2Credentials.setFlow(OAuth2FlowType)`
    `OAuth2Options` | `setHeaders(JsonObject headers)` Set custom headers to be sent with every request to the provider
    `OAuth2Options` | `setHttpClientOptions(HttpClientOptions httpClientOptions)`
    `OAuth2Options` | `setIntrospectionPath(String introspectionPath)` Set the provider token introspection resource path
    `void` | `setJwkMaxAgeInSeconds(long jwkMaxAgeInSeconds)` -1 means no rotation for JWKs
    `OAuth2Options` | `setJwkPath(String jwkPath)`
    `OAuth2Options` | `setJWTOptions(JWTOptions jwtOptions)`
    `OAuth2Options` | `setLogoutPath(String logoutPath)` Set the provider logout path
    `OAuth2Options` | `setPubSecKeys(List<PubSecKeyOptions> pubSecKeys)`
    `OAuth2Options` | `setRevocationPath(String revocationPath)` Set the Oauth2 revocation resource path.
    `OAuth2Options` | `setRotateJWKs(boolean rotateJWKs)` Deprecated. use `setJwkMaxAgeInSeconds(long)` instead
    `OAuth2Options` | `setScopeSeparator(String scopeSeparator)` Set the provider scope separator
    `OAuth2Options` | `setSite(String site)` Root URL for the provider without trailing slashes
    `OAuth2Options` | `setSupportedGrantTypes(List<String> supportedGrantTypes)`
    `OAuth2Options` | `setTenant(String tenant)` Sets an optional tenant.
    `OAuth2Options` | `setTokenPath(String tokenPath)`
    `OAuth2Options` | `setUserAgent(String userAgent)` Set a custom user agent to use when communicating to a provider
    `OAuth2Options` | `setUserInfoParameters(JsonObject userInfoParams)` Set custom parameters to be sent during the userInfo resource request
    `OAuth2Options` | `setUserInfoPath(String userInfoPath)` Set the provider userInfo resource path
    `OAuth2Options` | `setValidateIssuer(boolean validateIssuer)`
    `JsonObject` | `toJson()`
    `String` | `toString()`
    `void` | `validate()`

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

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

- - ### Constructor Detail

    - #### OAuth2Options

          public OAuth2Options()

      Default constructor

    - #### OAuth2Options

          public OAuth2Options(OAuth2Options other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### OAuth2Options

          public OAuth2Options(JsonObject json)

      Constructor to create an options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### getSite

          public String getSite()

    - #### getAuthorizationPath

          public String getAuthorizationPath()

      Get the Oauth2 authorization resource path. e.g.: /oauth/authorize
      Returns:
        authorization path

    - #### setAuthorizationPath

          public OAuth2Options setAuthorizationPath(String authorizationPath)

    - #### getTokenPath

          public String getTokenPath()

      Get the Oauth2 token resource path. e.g.: /oauth/token
      Returns:
        token path

    - #### setTokenPath

          public OAuth2Options setTokenPath(String tokenPath)

    - #### getRevocationPath

          public String getRevocationPath()

      Get the Oauth2 revocation resource path. e.g.: /oauth/revoke
      Returns:
        revocation path

    - #### setRevocationPath

          public OAuth2Options setRevocationPath(String revocationPath)

      Set the Oauth2 revocation resource path. e.g.: /oauth/revoke
      Returns:
        self

    - #### setSite

          public OAuth2Options setSite(String site)

      Root URL for the provider without trailing slashes
      Parameters:
        `site` - a url
      Returns:
        self

    - #### getClientID

          @Deprecated
          public String getClientID()

      Deprecated. see `getClientId()`

    - #### setClientID

          @Deprecated
          public OAuth2Options setClientID(String clientID)

      Deprecated. see `setClientId(String)`

    - #### getClientId

          public String getClientId()

      Get the provider client id
      Returns:
        client id

    - #### setClientId

          public OAuth2Options setClientId(String clientId)

      Set the provider client id
      Parameters:
        `clientId` - client id
      Returns:
        self

    - #### getClientSecret

          public String getClientSecret()

      Get the provider client secret
      Returns:
        the client secret

    - #### setClientSecret

          public OAuth2Options setClientSecret(String clientSecret)

      Set the provider client secret
      Parameters:
        `clientSecret` - client secret
      Returns:
        self

    - #### getClientAssertionType

          public String getClientAssertionType()

    - #### setClientAssertionType

          public OAuth2Options setClientAssertionType(String clientAssertionType)

    - #### getClientAssertion

          public String getClientAssertion()

    - #### setClientAssertion

          public OAuth2Options setClientAssertion(String clientAssertion)

    - #### getUserAgent

          public String getUserAgent()

      The User-Agent header to use when communicating with a provider
      Returns:
        the user agent string

    - #### setUserAgent

          public OAuth2Options setUserAgent(String userAgent)

      Set a custom user agent to use when communicating to a provider
      Parameters:
        `userAgent` - the user agent
      Returns:
        self

    - #### getHeaders

          public JsonObject getHeaders()

      Custom headers to send along with every request.
      Returns:
        the headers as a json structure

    - #### setHeaders

          public OAuth2Options setHeaders(JsonObject headers)

      Set custom headers to be sent with every request to the provider
      Parameters:
        `headers` - the headers
      Returns:
        self

    - #### getPubSecKeys

          public List<PubSecKeyOptions> getPubSecKeys()

      The provider PubSec key options
      Returns:
        the pub sec key options

    - #### setPubSecKeys

          public OAuth2Options setPubSecKeys(List<PubSecKeyOptions> pubSecKeys)

    - #### addPubSecKey

          public OAuth2Options addPubSecKey(PubSecKeyOptions pubSecKey)

    - #### getLogoutPath

          public String getLogoutPath()

      The provider logout path
      Returns:
        a logout resource path

    - #### setLogoutPath

          public OAuth2Options setLogoutPath(String logoutPath)

      Set the provider logout path
      Parameters:
        `logoutPath` - a logout resource path
      Returns:
        self

    - #### getUserInfoPath

          public String getUserInfoPath()

      The provider userInfo resource path
      Returns:
        a resouce path

    - #### setUserInfoPath

          public OAuth2Options setUserInfoPath(String userInfoPath)

      Set the provider userInfo resource path
      Parameters:
        `userInfoPath` - a resource path
      Returns:
        self

    - #### getScopeSeparator

          public String getScopeSeparator()

      Set the provider scope separator
      Returns:
        a single character string usually a space or a plus

    - #### setScopeSeparator

          public OAuth2Options setScopeSeparator(String scopeSeparator)

      Set the provider scope separator
      Parameters:
        `scopeSeparator` - a separator e.g.: ' ', '+', ','
      Returns:
        self

    - #### getExtraParameters

          public JsonObject getExtraParameters()

      Extra parameters to send to the provider
      Returns:
        a json representation of the parameters

    - #### setExtraParameters

          public OAuth2Options setExtraParameters(JsonObject extraParams)

      Set extra parameters to be sent to the provider on each request
      Parameters:
        `extraParams` - a json representation of the parameters
      Returns:
        self

    - #### getIntrospectionPath

          public String getIntrospectionPath()

      The provider token introspection resource path
      Returns:
        the resource path

    - #### setIntrospectionPath

          public OAuth2Options setIntrospectionPath(String introspectionPath)

      Set the provider token introspection resource path
      Parameters:
        `introspectionPath` - a resource path
      Returns:
        self

    - #### getUserInfoParameters

          public JsonObject getUserInfoParameters()

      Set the provider custom userInfo parameters to send when requesting them.
      Returns:
        a json representation of the extra parameters

    - #### setUserInfoParameters

          public OAuth2Options setUserInfoParameters(JsonObject userInfoParams)

      Set custom parameters to be sent during the userInfo resource request
      Parameters:
        `userInfoParams` - json representation of the parameters
      Returns:
        self

    - #### getJwkPath

          public String getJwkPath()

    - #### setJwkPath

          public OAuth2Options setJwkPath(String jwkPath)

    - #### getJWTOptions

          public JWTOptions getJWTOptions()

    - #### setJWTOptions

          public OAuth2Options setJWTOptions(JWTOptions jwtOptions)

    - #### getFlow

          @Deprecated
          public OAuth2FlowType getFlow()

      Deprecated. see `Oauth2Credentials.getFlow()`

    - #### setFlow

          @Deprecated
          public OAuth2Options setFlow(OAuth2FlowType flow)

      Deprecated. see `Oauth2Credentials.setFlow(OAuth2FlowType)`

    - #### isValidateIssuer

          public boolean isValidateIssuer()

    - #### setValidateIssuer

          public OAuth2Options setValidateIssuer(boolean validateIssuer)

    - #### getTenant

          public String getTenant()

    - #### setTenant

          public OAuth2Options setTenant(String tenant)

      Sets an optional tenant. Tenants are used in some OpenID servers as placeholders for the URLs. The tenant should be set prior to any URL as it affects the way the URLs will be stored.

      Some provders may name this differently, for example: `realm`.

      Parameters:
        `tenant` - the tenant/realm for this config.
      Returns:
        self

    - #### isRotateJWKs

          @Deprecated
          public boolean isRotateJWKs()

      Deprecated.

    - #### setRotateJWKs

          @Deprecated
          public OAuth2Options setRotateJWKs(boolean rotateJWKs)

      Deprecated. use `setJwkMaxAgeInSeconds(long)` instead
      Enable/Disable the JWKs rotation.
      Parameters:
        `rotateJWKs` - `true` to rotate keys as described in `OAuth2Auth.jWKSet(Handler)`.
      Returns:
        self

    - #### getSupportedGrantTypes

          public List<String> getSupportedGrantTypes()

      The provider supported grant types
      Returns:
        the supported grant types options

    - #### setSupportedGrantTypes

          public OAuth2Options setSupportedGrantTypes(List<String> supportedGrantTypes)

    - #### addSupportedGrantType

          public OAuth2Options addSupportedGrantType(String supportedGrantType)

    - #### replaceVariables

          public void replaceVariables(boolean strict)

    - #### validate

          public void validate()
                        throws IllegalStateException

      Throws:
        `IllegalStateException`

    - #### toJson

          public JsonObject toJson()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getHttpClientOptions

          public HttpClientOptions getHttpClientOptions()

    - #### setHttpClientOptions

          public OAuth2Options setHttpClientOptions(HttpClientOptions httpClientOptions)

    - #### getJwkMaxAgeInSeconds

          public long getJwkMaxAgeInSeconds()

    - #### setJwkMaxAgeInSeconds

          public void setJwkMaxAgeInSeconds(long jwkMaxAgeInSeconds)

      -1 means no rotation for JWKs
      Parameters:
        `jwkMaxAgeInSeconds` - timeout of JWKs rotation

Copyright © 2022 Eclipse. All rights reserved.