Class OAuth2CredentialSource
- java.lang.Object
-
- org.wildfly.security.credential.source.OAuth2CredentialSource
-
- All Implemented Interfaces:
CredentialSource
@Deprecated public class OAuth2CredentialSource extends Object implements CredentialSource
Deprecated.ACredentialSourcecapable of authenticating against a OAuth2 compliant authorization server and obtaining access tokens in form of aBearerTokenCredential.- Author:
- Pedro Igor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOAuth2CredentialSource.BuilderDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private Consumer<Map<String,String>>authenticationHandlerDeprecated.private static char[]defaultKeyMaterialDeprecated.private Supplier<HostnameVerifier>hostnameVerifierSupplierDeprecated.private StringscopesDeprecated.private Supplier<SSLContext>sslContextSupplierDeprecated.private URLtokenEndpointUriDeprecated.-
Fields inherited from interface org.wildfly.security.credential.source.CredentialSource
NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description privateOAuth2CredentialSource(URL tokenEndpointUrl, Consumer<Map<String,String>> authenticationHandler, String scopes, Supplier<SSLContext> sslContextSupplier, Supplier<HostnameVerifier> hostnameVerifierSupplier)Deprecated.Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static OAuth2CredentialSource.Builderbuilder(URL tokenEndpointUrl)Deprecated.Creates a newOAuth2CredentialSource.Builderinstance in order to configure and build aOAuth2CredentialSource.private byte[]buildParameters(Map<String,String> parameters)Deprecated.<C extends Credential>
CgetCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)Deprecated.Acquire a credential of the given type.SupportLevelgetCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)Deprecated.Determine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.private booleanisHttps(URL tokenEndpointUrl)Deprecated.private HttpURLConnectionopenConnection()Deprecated.private SSLContextresolveSSLContext()Deprecated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.credential.source.CredentialSource
applyToCredential, applyToCredential, applyToCredential, getCredential, getCredential, getCredentialAcquireSupport, getCredentialAcquireSupport, with, without, without, without
-
-
-
-
Field Detail
-
tokenEndpointUri
private final URL tokenEndpointUri
Deprecated.
-
scopes
private String scopes
Deprecated.
-
sslContextSupplier
private final Supplier<SSLContext> sslContextSupplier
Deprecated.
-
hostnameVerifierSupplier
private final Supplier<HostnameVerifier> hostnameVerifierSupplier
Deprecated.
-
defaultKeyMaterial
private static final char[] defaultKeyMaterial
Deprecated.
-
-
Constructor Detail
-
OAuth2CredentialSource
private OAuth2CredentialSource(URL tokenEndpointUrl, Consumer<Map<String,String>> authenticationHandler, String scopes, Supplier<SSLContext> sslContextSupplier, Supplier<HostnameVerifier> hostnameVerifierSupplier)
Deprecated.Creates a new instance.- Parameters:
tokenEndpointUrl- the OAuth2 Token EndpointURLauthenticationHandler- a callback that can be used to push addition parameters to requests sent to the authorization serverscopes- a string with the scope of the access requestsslContextSupplier- a supplier from where theSSLContextis obtained in case the token endpoint is using TLS/HTTPShostnameVerifierSupplier- a supplier from where theHostnameVerifieris obtained in case the token endpoint is using TLS/HTTPS
-
-
Method Detail
-
builder
public static OAuth2CredentialSource.Builder builder(URL tokenEndpointUrl)
Deprecated.Creates a newOAuth2CredentialSource.Builderinstance in order to configure and build aOAuth2CredentialSource.- Parameters:
tokenEndpointUrl- the token endpoint that will be used to obtain OAuth2 access tokens- Returns:
- a new builder instance
-
getCredentialAcquireSupport
public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
Deprecated.Description copied from interface:CredentialSourceDetermine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.- Specified by:
getCredentialAcquireSupportin interfaceCredentialSource- Parameters:
credentialType- the credential type class (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
- the level of support for this credential type (not
null) - Throws:
IOException- if the credential source failed to determine the support level
-
getCredential
public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
Deprecated.Description copied from interface:CredentialSourceAcquire a credential of the given type. The credential type is defined by itsClassand an optionalalgorithmName. If the algorithm name is not given, then the query is performed for any algorithm of the given type.- Specified by:
getCredentialin interfaceCredentialSource- Type Parameters:
C- the credential type- Parameters:
credentialType- the credential type class (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
- the credential, or
nullif the principal has no credential of that type - Throws:
IOException- if the realm is not able to handle requests for any reason
-
resolveSSLContext
private SSLContext resolveSSLContext()
Deprecated.
-
openConnection
private HttpURLConnection openConnection() throws IOException
Deprecated.- Throws:
IOException
-
isHttps
private boolean isHttps(URL tokenEndpointUrl)
Deprecated.
-
-