public final class AuthenticationContextConfigurationClient extends Object
Modifier and Type | Field and Description |
---|---|
static PrivilegedAction<AuthenticationContextConfigurationClient> |
ACTION
A reusable privileged action to create a new configuration client.
|
Constructor and Description |
---|
AuthenticationContextConfigurationClient()
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
Socket |
connect(URI uri,
AuthenticationConfiguration configuration,
int protocolDefaultPort)
Deprecated.
Use
Inet.getResolved(java.net.URI, int) with Socket.Socket(InetAddress, int) instead. |
SaslClient |
createSaslClient(URI uri,
AuthenticationConfiguration configuration,
Collection<String> offeredMechanisms)
Create a SASL client using the given URI and configuration from the given SASL client factory.
|
SaslClient |
createSaslClient(URI uri,
AuthenticationConfiguration configuration,
Collection<String> offeredMechanisms,
UnaryOperator<SaslClientFactory> factoryOperator)
Create a SASL client using the given URI and configuration from the given SASL client factory.
|
SaslClient |
createSaslClient(URI uri,
AuthenticationConfiguration configuration,
Collection<String> offeredMechanisms,
UnaryOperator<SaslClientFactory> factoryOperator,
SSLSession sslSession)
Create a SASL client using the given URI and configuration from the given SASL client factory.
|
AuthenticationConfiguration |
getAuthenticationConfiguration(URI uri,
AuthenticationContext authenticationContext)
Get the authentication configuration which matches the given URI, or
AuthenticationConfiguration.EMPTY if there is none. |
AuthenticationConfiguration |
getAuthenticationConfiguration(URI uri,
AuthenticationContext authenticationContext,
int protocolDefaultPort)
Get the authentication configuration which matches the given URI, or
AuthenticationConfiguration.EMPTY if there is none, setting
a default protocol port. |
AuthenticationConfiguration |
getAuthenticationConfiguration(URI uri,
AuthenticationContext authenticationContext,
int protocolDefaultPort,
String abstractType,
String abstractTypeAuthority)
Get the authentication configuration which matches the given URI and type, or
AuthenticationConfiguration.EMPTY if there is none, setting
a default protocol port. |
AuthenticationConfiguration |
getAuthenticationConfigurationNoOverrides(URI uri,
AuthenticationContext authenticationContext,
String abstractType,
String abstractTypeAuthority)
Get the authentication configuration which matches the given URI and type, or
AuthenticationConfiguration.EMPTY if there is none. |
Principal |
getAuthorizationPrincipal(AuthenticationConfiguration configuration)
Get the authorization principal to use for the given configuration.
|
CallbackHandler |
getCallbackHandler(AuthenticationConfiguration configuration)
Get an authentication callback handler for the given configuration.
|
InetSocketAddress |
getDestinationInetSocketAddress(AuthenticationConfiguration configuration)
Deprecated.
This configuration is not supported by most providers and will be removed in a future release.
|
InetSocketAddress |
getDestinationInetSocketAddress(URI uri,
AuthenticationConfiguration configuration,
int protocolDefaultPort)
Deprecated.
Use
Inet.getResolved(java.net.URI, int) instead. |
Principal |
getPrincipal(AuthenticationConfiguration configuration)
Get the authentication principal to use for the given configuration.
|
Supplier<Provider[]> |
getProviderSupplier(AuthenticationConfiguration configuration)
|
String |
getRealHost(AuthenticationConfiguration configuration)
Deprecated.
This configuration is not supported by most providers and will be removed in a future release.
|
String |
getRealHost(URI uri,
AuthenticationConfiguration configuration)
Deprecated.
Use
URI.getHost() instead. |
int |
getRealPort(AuthenticationConfiguration configuration)
Deprecated.
This configuration is not supported by most providers and will be removed in a future release.
|
int |
getRealPort(URI uri,
AuthenticationConfiguration configuration)
Deprecated.
Use
URI.getPort() instead. |
String |
getRealProtocol(AuthenticationConfiguration configuration)
Deprecated.
This configuration is not supported by most providers and will be removed in a future release.
|
String |
getRealProtocol(URI uri,
AuthenticationConfiguration configuration)
Deprecated.
Use
URI.getScheme() instead. |
String |
getSaslProtocol(AuthenticationConfiguration configuration)
Get the actual sasl protocol to use for the given configuration.
|
SSLContext |
getSSLContext(URI uri,
AuthenticationContext authenticationContext)
Get the SSL context which matches the given URI, or
SSLContext.getDefault() if there is none. |
SSLContext |
getSSLContext(URI uri,
AuthenticationContext authenticationContext,
String abstractType,
String abstractTypeAuthority)
Get the SSL context which matches the given URI and type, or
SSLContext.getDefault() if there is none. |
SecurityFactory<SSLContext> |
getSSLContextFactory(URI uri,
AuthenticationContext authenticationContext,
String abstractType,
String abstractTypeAuthority)
Get the SSL context factory which matches the given URI and type, or
SSLContext.getDefault() if there is none. |
public static final PrivilegedAction<AuthenticationContextConfigurationClient> ACTION
public AuthenticationContextConfigurationClient() throws SecurityException
createAuthenticationContextConfigurationClient
ElytronPermission
.SecurityException
- if the caller does not have permission to instantiate this classpublic AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext)
AuthenticationConfiguration.EMPTY
if there is none.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)public AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort)
AuthenticationConfiguration.EMPTY
if there is none, setting
a default protocol port.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)protocolDefaultPort
- the protocol-default portpublic AuthenticationConfiguration getAuthenticationConfiguration(URI uri, AuthenticationContext authenticationContext, int protocolDefaultPort, String abstractType, String abstractTypeAuthority)
AuthenticationConfiguration.EMPTY
if there is none, setting
a default protocol port. The user name, host, port, and protocol from the URI are copied into the configuration when the configuration does not already
establish values for those fields.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)protocolDefaultPort
- the protocol-default portabstractType
- the abstract type (may be null
)abstractTypeAuthority
- the abstract type authority (may be null
)public AuthenticationConfiguration getAuthenticationConfigurationNoOverrides(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority)
AuthenticationConfiguration.EMPTY
if there is none.
The user name from the URI is copied into the configuration if the configuration does not already establish a value for that field.
No host, port, or protocol information is copied to the resultant configuration from the URI.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)abstractType
- the abstract type (may be null
)abstractTypeAuthority
- the abstract type authority (may be null
)public SSLContext getSSLContext(URI uri, AuthenticationContext authenticationContext) throws GeneralSecurityException
SSLContext.getDefault()
if there is none.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)GeneralSecurityException
public SSLContext getSSLContext(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority) throws GeneralSecurityException
SSLContext.getDefault()
if there is none.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)abstractType
- the abstract type (may be null
)abstractTypeAuthority
- the abstract type authority (may be null
)GeneralSecurityException
public SecurityFactory<SSLContext> getSSLContextFactory(URI uri, AuthenticationContext authenticationContext, String abstractType, String abstractTypeAuthority)
SSLContext.getDefault()
if there is none.uri
- the URI to match (must not be null
)authenticationContext
- the authentication context to examine (must not be null
)abstractType
- the abstract type (may be null
)abstractTypeAuthority
- the abstract type authority (may be null
)null
)public CallbackHandler getCallbackHandler(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)@Deprecated public String getRealHost(URI uri, AuthenticationConfiguration configuration)
URI.getHost()
instead.uri
- the URI (must not be null
)configuration
- the configuration (must not be null
)@Deprecated public String getRealHost(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)@Deprecated public int getRealPort(URI uri, AuthenticationConfiguration configuration)
URI.getPort()
instead.uri
- the URI (must not be null
)configuration
- the configuration (must not be null
)@Deprecated public int getRealPort(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)@Deprecated public String getRealProtocol(URI uri, AuthenticationConfiguration configuration)
URI.getScheme()
instead.uri
- the URI (must not be null
)configuration
- the configuration (must not be null
)null
if none is configured and none is present on the URI@Deprecated public String getRealProtocol(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)null
if none is configuredpublic String getSaslProtocol(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)public Principal getPrincipal(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)null
)public Principal getAuthorizationPrincipal(AuthenticationConfiguration configuration)
configuration
- the configuration (must not be null
)null
if none is specifiedpublic SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms) throws SaslException
uri
- the target URI (must not be null
)configuration
- the authentication configuration (must not be null
)offeredMechanisms
- the available mechanisms (must not be null
)null
if no clients were available or could be configuredSaslException
public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms, UnaryOperator<SaslClientFactory> factoryOperator) throws SaslException
uri
- the target URI (must not be null
)configuration
- the authentication configuration (must not be null
)offeredMechanisms
- the available mechanisms (must not be null
)factoryOperator
- a UnaryOperator
to apply to the SaslClientFactory
usednull
if no clients were available or could be configuredSaslException
public SaslClient createSaslClient(URI uri, AuthenticationConfiguration configuration, Collection<String> offeredMechanisms, UnaryOperator<SaslClientFactory> factoryOperator, SSLSession sslSession) throws SaslException
uri
- the target URI (must not be null
)configuration
- the authentication configuration (must not be null
)offeredMechanisms
- the available mechanisms (must not be null
)factoryOperator
- a UnaryOperator
to apply to the SaslClientFactory
usedsslSession
- the SSL session active for this connection, or null
for nonenull
if no clients were available or could be configuredSaslException
@Deprecated public InetSocketAddress getDestinationInetSocketAddress(URI uri, AuthenticationConfiguration configuration, int protocolDefaultPort)
Inet.getResolved(java.net.URI, int)
instead.uri
- the connection URI (must not be null
)configuration
- the authentication configuration to use (must not be null
)protocolDefaultPort
- the default port for the protocol@Deprecated public InetSocketAddress getDestinationInetSocketAddress(AuthenticationConfiguration configuration)
configuration
- the authentication configuration to use (must not be null
)@Deprecated public Socket connect(URI uri, AuthenticationConfiguration configuration, int protocolDefaultPort) throws IOException
Inet.getResolved(java.net.URI, int)
with Socket.Socket(InetAddress, int)
instead.uri
- the connection URIconfiguration
- the authentication configuration to useprotocolDefaultPort
- the default port for the protocol used in the URIIOException
- if socket creation or connection fails for some reasonpublic Supplier<Provider[]> getProviderSupplier(AuthenticationConfiguration configuration)
configuration
- the authentication configuration to use (must not be null
)Provider
instances (not null
)Copyright © 2020 JBoss by Red Hat. All rights reserved.