Class OAuth2IntrospectValidator.Builder
- java.lang.Object
-
- org.wildfly.security.auth.realm.token.validator.OAuth2IntrospectValidator.Builder
-
- Enclosing class:
- OAuth2IntrospectValidator
public static class OAuth2IntrospectValidator.Builder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private String
clientId
private String
clientSecret
private int
connectionTimeout
private HostnameVerifier
hostnameVerifier
private int
readTimeout
private SSLContext
sslContext
private URL
tokenIntrospectionUrl
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2IntrospectValidator
build()
Returns aOAuth2IntrospectValidator
instance based on all the configuration provided with this builder.OAuth2IntrospectValidator.Builder
clientId(String clientId)
The identifier of a client registered within the OAuth2 Authorization Server that will be used to authenticate this server in order to validate bearer tokens arriving to this server.OAuth2IntrospectValidator.Builder
clientSecret(String clientSecret)
The secret of the client identified by the givenclientId
.OAuth2IntrospectValidator.Builder
connectionTimeout(int connectionTimeout)
Sets the connection timeout to a specified timeout, in milliseconds.OAuth2IntrospectValidator.Builder
readTimeout(int readTimeout)
Sets the read timeout to a specified timeout, in milliseconds.OAuth2IntrospectValidator.Builder
tokenIntrospectionUrl(URL url)
AnURL
pointing to a RFC-7662 OAuth2 Token Introspection compatible endpoint.OAuth2IntrospectValidator.Builder
useSslContext(SSLContext sslContext)
A predefinedSSLContext
that will be used to connect to the token introspection endpoint when using SSL/TLS.OAuth2IntrospectValidator.Builder
useSslHostnameVerifier(HostnameVerifier hostnameVerifier)
AHostnameVerifier
that will be used to validate the hostname when using SSL/TLS.
-
-
-
Field Detail
-
clientId
private String clientId
-
clientSecret
private String clientSecret
-
tokenIntrospectionUrl
private URL tokenIntrospectionUrl
-
sslContext
private SSLContext sslContext
-
hostnameVerifier
private HostnameVerifier hostnameVerifier
-
connectionTimeout
private int connectionTimeout
-
readTimeout
private int readTimeout
-
-
Method Detail
-
tokenIntrospectionUrl
public OAuth2IntrospectValidator.Builder tokenIntrospectionUrl(URL url)
AnURL
pointing to a RFC-7662 OAuth2 Token Introspection compatible endpoint.- Parameters:
url
- the token introspection endpoint- Returns:
- this instance
-
clientId
public OAuth2IntrospectValidator.Builder clientId(String clientId)
The identifier of a client registered within the OAuth2 Authorization Server that will be used to authenticate this server in order to validate bearer tokens arriving to this server.
Please note that the client will be usually a confidential client with both an identifier and secret configured in order to authenticate against the token introspection endpoint. In this case, the endpoint must support HTTP BASIC authentication using the client credentials (both id and secret).
- Parameters:
clientId
- the identifier of a client within the OAUth2 Authorization Server- Returns:
- this instance
-
clientSecret
public OAuth2IntrospectValidator.Builder clientSecret(String clientSecret)
The secret of the client identified by the givenclientId
.- Parameters:
clientSecret
- the secret of the client- Returns:
- this instance
-
useSslContext
public OAuth2IntrospectValidator.Builder useSslContext(SSLContext sslContext)
A predefined
SSLContext
that will be used to connect to the token introspection endpoint when using SSL/TLS. This configuration is mandatory if the given token introspection url is using SSL/TLS.- Parameters:
sslContext
- the SSL context- Returns:
- this instance
-
useSslHostnameVerifier
public OAuth2IntrospectValidator.Builder useSslHostnameVerifier(HostnameVerifier hostnameVerifier)
AHostnameVerifier
that will be used to validate the hostname when using SSL/TLS. This configuration is mandatory if the given token introspection url is using SSL/TLS.- Parameters:
hostnameVerifier
- the hostname verifier- Returns:
- this instance
-
connectionTimeout
public OAuth2IntrospectValidator.Builder connectionTimeout(int connectionTimeout)
Sets the connection timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when connecting to a resource. A timeout of zero is interpreted as an infinite timeout.- Parameters:
connectionTimeout
- the connection timeout- Returns:
- this instance
-
readTimeout
public OAuth2IntrospectValidator.Builder readTimeout(int readTimeout)
Sets the read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from Input stream when a connection is established to a resource. A timeout of zero is interpreted as an infinite timeout.- Parameters:
readTimeout
- the read timeout- Returns:
- this instance
-
build
public OAuth2IntrospectValidator build()
Returns aOAuth2IntrospectValidator
instance based on all the configuration provided with this builder.- Returns:
- a new
OAuth2IntrospectValidator
instance with all the given configuration
-
-