Top Description Inners Fields Constructors Methods
com.oracle.bmc.auth

public Class AbstractRequestingAuthenticationDetailsProvider

extends Object
implements BasicAuthenticationDetailsProvider
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider, com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
Known Direct Subclasses
com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider, com.oracle.bmc.auth.ResourcePrincipalAuthenticationDetailsProvider
Annotations
@InternalSdk
Imports
com.oracle.bmc.InternalSdk, com.oracle.bmc.auth.internal.AuthUtils, .FederationClient, com.oracle.bmc.http.ClientConfigurator, java.io.ByteArrayInputStream, .InputStream, java.security.KeyPair, java.security.interfaces.RSAPrivateKey, .RSAPublicKey, java.util.ArrayList, .List, .Set

Base class for authentication details providers that make remote requests.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract static class
protected static class
AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier

Helper class to cache the private key as bytes so we don't have to parse it every time.

Field Summary

Modifier and TypeField and Description
protected final FederationClient
protected final AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getKeyId()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getKeyId.

Returns the keyId used to sign requests.

public String
getPassPhrase()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassPhrase.

Deprecated

Returns the optional pass phrase for the (encrypted) private key.

public char[]

Returns:

The pass phrase as character array, or null if not applicable
getPassphraseCharacters
()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassphraseCharacters.

Returns the optional pass phrase for the (encrypted) private key, as a character array.

public InputStream
getPrivateKey()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPrivateKey.

Returns a new InputStream to the private key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

federationClientback to summary
protected final FederationClient federationClient
sessionKeySupplierback to summary
protected final AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier sessionKeySupplier

Constructor Detail

AbstractRequestingAuthenticationDetailsProviderback to summary
public AbstractRequestingAuthenticationDetailsProvider(FederationClient federationClient, SessionKeySupplier sessionKeySupplier)

Method Detail

getKeyIdback to summary
public String getKeyId()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getKeyId.

Doc from com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getKeyId.

Returns the keyId used to sign requests.

Returns:String

The keyId.

Annotations
@Override
getPassPhraseback to summary
public String getPassPhrase()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassPhrase.

Doc from com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassPhrase.

Deprecated

Returns the optional pass phrase for the (encrypted) private key.

Returns:String

The pass phrase, or null if not applicable

Annotations
@Deprecated
@Override
getPassphraseCharactersback to summary
public char[] getPassphraseCharacters()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPassphraseCharacters.

Returns the optional pass phrase for the (encrypted) private key, as a character array.

Returns:char[]

The pass phrase as character array, or null if not applicable

Annotations
@Override
getPrivateKeyback to summary
public InputStream getPrivateKey()

Implements com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPrivateKey.

Doc from com.oracle.bmc.auth.BasicAuthenticationDetailsProvider.getPrivateKey.

Returns a new InputStream to the private key. This stream should be closed by the caller, implementations should return new streams each time.

Returns:InputStream

A new InputStream.

Annotations
@Override
com.oracle.bmc.auth back to summary

protected abstract Class AbstractRequestingAuthenticationDetailsProvider.Builder<B extends AbstractRequestingAuthenticationDetailsProvider.Builder<B>>

extends Object
Class Inheritance
  • java.lang.Object
  • com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider.Builder
Known Direct Subclasses
com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder
Type Parameters
<B>
builder class

Base class for builders.

Field Summary

Modifier and TypeField and Description
protected List<ClientConfigurator>
protected FederationClient
protected ClientConfigurator
protected Set<X509CertificateSupplier>
protected SessionKeySupplier

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public B

Returns:

this builder
additionalFederationClientConfigurator
(ClientConfigurator
the additional client configurator
additionalClientConfigurator
)

Add an additional client configurator to be run after the primary configurator.

public B
federationClientConfigurator(ClientConfigurator clientConfigurator)

Configures the ClientConfigurator to set on the REST client used by the federation client, if any.

public B
intermediateCertificateSuppliers(Set<X509CertificateSupplier> intermediateCertificateSuppliers)

Configures the set of intermediate certificate suppliers to use, if any.

public B
sessionKeySupplier(SessionKeySupplier sessionKeySupplier)

Configures the custom SessionKeySupplier to use.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

additionalFederationClientConfiguratorsback to summary
protected List<ClientConfigurator> additionalFederationClientConfigurators
federationClientback to summary
protected FederationClient federationClient
federationClientConfiguratorback to summary
protected ClientConfigurator federationClientConfigurator
intermediateCertificateSuppliersback to summary
protected Set<X509CertificateSupplier> intermediateCertificateSuppliers
sessionKeySupplierback to summary
protected SessionKeySupplier sessionKeySupplier

Constructor Detail

Builderback to summary
protected Builder()

Method Detail

additionalFederationClientConfiguratorback to summary
public B additionalFederationClientConfigurator(ClientConfigurator additionalClientConfigurator)

Add an additional client configurator to be run after the primary configurator.

Parameters
additionalClientConfigurator:ClientConfigurator

the additional client configurator

Returns:B

this builder

federationClientConfiguratorback to summary
public B federationClientConfigurator(ClientConfigurator clientConfigurator)

Configures the ClientConfigurator to set on the REST client used by the federation client, if any.

intermediateCertificateSuppliersback to summary
public B intermediateCertificateSuppliers(Set<X509CertificateSupplier> intermediateCertificateSuppliers)

Configures the set of intermediate certificate suppliers to use, if any.

sessionKeySupplierback to summary
public B sessionKeySupplier(SessionKeySupplier sessionKeySupplier)

Configures the custom SessionKeySupplier to use.

com.oracle.bmc.auth back to summary

protected Class AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier

extends Object
implements SessionKeySupplier
Class Inheritance
  • java.lang.Object
  • com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier
All Implemented Interfaces
com.oracle.bmc.auth.SessionKeySupplier

Helper class to cache the private key as bytes so we don't have to parse it every time. The key only changes during calls to refresh.

All methods in this class that are called outside of this class should be synchronized.

Field Summary

Modifier and TypeField and Description
private final SessionKeySupplier
private RSAPrivateKey
private byte[]

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public KeyPair
getKeyPair()

Implements com.oracle.bmc.auth.SessionKeySupplier.getKeyPair.

Returns the current RSA key pair.

protected synchronized byte[]
public synchronized void
refreshKeys()

Implements com.oracle.bmc.auth.SessionKeySupplier.refreshKeys.

If the auth service-issued security token expires, the federation client will try to re-generate a new set of keys by calling this method.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final SessionKeySupplier delegate
lastPrivateKeyback to summary
private RSAPrivateKey lastPrivateKey
privateKeyBytesback to summary
private byte[] privateKeyBytes

Constructor Detail

CachingSessionKeySupplierback to summary
protected CachingSessionKeySupplier(final SessionKeySupplier delegate)

Method Detail

getKeyPairback to summary
public KeyPair getKeyPair()

Implements com.oracle.bmc.auth.SessionKeySupplier.getKeyPair.

Doc from com.oracle.bmc.auth.SessionKeySupplier.getKeyPair.

Returns the current RSA key pair.

Returns:KeyPair

The RSA key pair.

Annotations
@Override
getPrivateKeyBytesback to summary
protected synchronized byte[] getPrivateKeyBytes()
refreshKeysback to summary
public synchronized void refreshKeys()

Implements com.oracle.bmc.auth.SessionKeySupplier.refreshKeys.

Doc from com.oracle.bmc.auth.SessionKeySupplier.refreshKeys.

If the auth service-issued security token expires, the federation client will try to re-generate a new set of keys by calling this method. The implementer should create a new pair of keys for security reasons.

Refreshing keys should not be a long-running blocking call. You can refresh keys in an async thread and return from this method immediately. When the async process is done refreshing the keys, the client code will automatically pick up the latest set of keys and update the security token accordingly

Annotations
@Override
setPrivateKeyBytesback to summary
private void setPrivateKeyBytes(RSAPrivateKey privateKey)