Class OAuth2Options
java.lang.Object
io.vertx.ext.auth.oauth2.OAuth2Options
Options describing how an OAuth2
HttpClient will make connections.- Author:
- Paulo Lopes
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorOAuth2Options(JsonObject json) Constructor to create an options from JSONOAuth2Options(OAuth2Options other) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionaddJwk(JsonObject jwk) Adds a local JWKsaddPubSecKey(PubSecKeyOptions pubSecKey) addSupportedGrantType(String supportedGrantType) Get the Oauth2 authorization resource path. e.g.: /oauth/authorizeGet the provider client idGet the provider client secretExtra parameters to send to the providerCustom headers to send along with every request.The provider token introspection resource pathlonggetJwks()The provider logout pathThe provider PubSec key optionsGet the Oauth2 revocation resource path. e.g.: /oauth/revokeSet the provider scope separatorgetSite()The provider supported grant typesGet the Oauth2 token resource path. e.g.: /oauth/tokenThe User-Agent header to use when communicating with a providerSet the provider custom userInfo parameters to send when requesting them.The provider userInfo resource pathbooleanbooleanvoidreplaceVariables(boolean strict) setAuthorizationPath(String authorizationPath) setClientAssertion(String clientAssertion) setClientAssertionType(String clientAssertionType) setClientId(String clientId) Set the provider client idsetClientSecret(String clientSecret) Set the provider client secretsetExtraParameters(JsonObject extraParams) Set extra parameters to be sent to the provider on each requestsetHeaders(JsonObject headers) Set custom headers to be sent with every request to the providersetHttpClientOptions(HttpClientOptions httpClientOptions) setIntrospectionPath(String introspectionPath) Set the provider token introspection resource pathvoidsetJwkMaxAgeInSeconds(long jwkMaxAgeInSeconds) -1 means no rotation for JWKssetJwkPath(String jwkPath) setJwks(List<JsonObject> jwks) Sets the initial local JWKssetJWTOptions(JWTOptions jwtOptions) setLogoutPath(String logoutPath) Set the provider logout pathsetPubSecKeys(List<PubSecKeyOptions> pubSecKeys) setRevocationPath(String revocationPath) Set the Oauth2 revocation resource path. e.g.: /oauth/revokesetScopeSeparator(String scopeSeparator) Set the provider scope separatorRoot URL for the provider without trailing slashessetSupportedGrantTypes(List<String> supportedGrantTypes) Sets an optional tenant.setTokenPath(String tokenPath) setUseBasicAuthorization(boolean useBasicAuthorization) setUserAgent(String userAgent) Set a custom user agent to use when communicating to a providersetUserInfoParameters(JsonObject userInfoParams) Set custom parameters to be sent during the userInfo resource requestsetUserInfoPath(String userInfoPath) Set the provider userInfo resource pathsetValidateIssuer(boolean validateIssuer) toJson()toString()voidvalidate()
-
Constructor Details
-
OAuth2Options
public OAuth2Options()Default constructor -
OAuth2Options
-
OAuth2Options
Constructor to create an options from JSON- Parameters:
json- the JSON
-
-
Method Details
-
getSite
-
getAuthorizationPath
Get the Oauth2 authorization resource path. e.g.: /oauth/authorize- Returns:
- authorization path
-
setAuthorizationPath
-
getTokenPath
Get the Oauth2 token resource path. e.g.: /oauth/token- Returns:
- token path
-
setTokenPath
-
getRevocationPath
Get the Oauth2 revocation resource path. e.g.: /oauth/revoke- Returns:
- revocation path
-
setRevocationPath
Set the Oauth2 revocation resource path. e.g.: /oauth/revoke- Returns:
- self
-
setSite
Root URL for the provider without trailing slashes- Parameters:
site- a url- Returns:
- self
-
getClientId
-
setClientId
Set the provider client id- Parameters:
clientId- client id- Returns:
- self
-
getClientSecret
-
setClientSecret
Set the provider client secret- Parameters:
clientSecret- client secret- Returns:
- self
-
setUseBasicAuthorization
-
isUseBasicAuthorization
public boolean isUseBasicAuthorization() -
getClientAssertionType
-
setClientAssertionType
-
getClientAssertion
-
setClientAssertion
-
getUserAgent
The User-Agent header to use when communicating with a provider- Returns:
- the user agent string
-
setUserAgent
Set a custom user agent to use when communicating to a provider- Parameters:
userAgent- the user agent- Returns:
- self
-
getHeaders
Custom headers to send along with every request.- Returns:
- the headers as a json structure
-
setHeaders
Set custom headers to be sent with every request to the provider- Parameters:
headers- the headers- Returns:
- self
-
getPubSecKeys
The provider PubSec key options- Returns:
- the pub sec key options
-
setPubSecKeys
-
addPubSecKey
-
getLogoutPath
-
setLogoutPath
Set the provider logout path- Parameters:
logoutPath- a logout resource path- Returns:
- self
-
getUserInfoPath
-
setUserInfoPath
Set the provider userInfo resource path- Parameters:
userInfoPath- a resource path- Returns:
- self
-
getScopeSeparator
Set the provider scope separator- Returns:
- a single character string usually a space or a plus
-
setScopeSeparator
Set the provider scope separator- Parameters:
scopeSeparator- a separator e.g.: ' ', '+', ','- Returns:
- self
-
getExtraParameters
Extra parameters to send to the provider- Returns:
- a json representation of the parameters
-
setExtraParameters
Set extra parameters to be sent to the provider on each request- Parameters:
extraParams- a json representation of the parameters- Returns:
- self
-
getIntrospectionPath
The provider token introspection resource path- Returns:
- the resource path
-
setIntrospectionPath
Set the provider token introspection resource path- Parameters:
introspectionPath- a resource path- Returns:
- self
-
getUserInfoParameters
Set the provider custom userInfo parameters to send when requesting them.- Returns:
- a json representation of the extra parameters
-
setUserInfoParameters
Set custom parameters to be sent during the userInfo resource request- Parameters:
userInfoParams- json representation of the parameters- Returns:
- self
-
getJwkPath
-
setJwkPath
-
getJWTOptions
-
setJWTOptions
-
isValidateIssuer
public boolean isValidateIssuer() -
setValidateIssuer
-
getTenant
-
setTenant
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
-
getSupportedGrantTypes
-
setSupportedGrantTypes
-
addSupportedGrantType
-
replaceVariables
public void replaceVariables(boolean strict) -
validate
- Throws:
IllegalStateException
-
toJson
-
toString
-
getHttpClientOptions
-
setHttpClientOptions
-
getJwkMaxAgeInSeconds
public long getJwkMaxAgeInSeconds() -
setJwkMaxAgeInSeconds
public void setJwkMaxAgeInSeconds(long jwkMaxAgeInSeconds) -1 means no rotation for JWKs- Parameters:
jwkMaxAgeInSeconds- timeout of JWKs rotation
-
getJwks
-
setJwks
Sets the initial local JWKs- Parameters:
jwks- a json array as defined in https://tools.ietf.org/html/rfc7517#section-5- Returns:
- self
-
addJwk
Adds a local JWKs- Parameters:
jwk- a single keyas defined in https://tools.ietf.org/html/rfc7517#section-5- Returns:
- self
-