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

public Class InstancePrincipalsAuthenticationDetailsProvider

extends AbstractRequestingAuthenticationDetailsProvider
implements RegionProvider, RefreshableOnNotAuthenticatedProvider<String>, ConfigurableRefreshOnNotAuthenticatedProvider<String>
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider, com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider, com.oracle.bmc.auth.RegionProvider
Annotations
@AuthCachingPolicy
cacheKeyId:false
cachePrivateKey:false
Imports
com.oracle.bmc.Region, com.oracle.bmc.auth.internal.FederationClient, org.slf4j.Logger, java.time.Duration

Implementation of BasicAuthenticationDetailsProvider that integrates with instance principal authentication endpoints to generate service tokens used for actual signing.

Also uses AuthCachingPolicy to disable caching (as the values for signing requests may be rotated periodically).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

Builder for InstancePrincipalsAuthenticationDetailsProviderBuilder.

Field Summary

Modifier and TypeField and Description
private static final Logger
private final Region
Inherited from com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider:
federationClientsessionKeySupplier

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

Returns:

A new builder instance.
builder
()

Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.

public Region
public String
refresh()

Implements com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider.refresh.

Refreshes the authentication data used by the provider

public String
refreshIfExpiringWithin(Duration
the duration to check
time
)

Implements com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Refreshes the authentication data used by the provider if the token is expiring within the provided duration

public String
refreshIfExpiringWithin(Duration
the duration to check
time
,
boolean
boolean value to enable/disable refresh of keys
refreshKeys
)

Implements com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Refreshes the authentication data used by the provider if the token is expiring within the provided duration and allows to enable/disable refresh of keys

public String

Returns:

the refreshed authentication data
refreshSecurityToken
()
Deprecated use refresh() instead

Refreshes the authentication data used by the provider

Inherited from com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider:
getKeyIdgetPassPhrasegetPassphraseCharactersgetPrivateKey

Field Detail

LOGback to summary
private static final Logger LOG
regionback to summary
private final Region region

Constructor Detail

InstancePrincipalsAuthenticationDetailsProviderback to summary
private InstancePrincipalsAuthenticationDetailsProvider(FederationClient federationClient, SessionKeySupplier sessionKeySupplier, Region region)

Method Detail

builderback to summary
public static InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder builder()

Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.

Returns:InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

A new builder instance.

getRegionback to summary
public Region getRegion()

Implements com.oracle.bmc.auth.RegionProvider.getRegion.

Doc from com.oracle.bmc.auth.RegionProvider.getRegion.

Returns the region.

Returns:Region

Region object.

Annotations
@Override
refreshback to summary
public String refresh()

Implements com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider.refresh.

Doc from com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider.refresh.

Refreshes the authentication data used by the provider

Returns:String

the refreshed authentication data

Annotations
@Override
refreshIfExpiringWithinback to summary
public String refreshIfExpiringWithin(Duration time)

Implements com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Doc from com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Refreshes the authentication data used by the provider if the token is expiring within the provided duration

Parameters
time:Duration

the duration to check

Returns:String

the refreshed authentication data

Annotations
@Override
refreshIfExpiringWithinback to summary
public String refreshIfExpiringWithin(Duration time, boolean refreshKeys)

Implements com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Doc from com.oracle.bmc.auth.ConfigurableRefreshOnNotAuthenticatedProvider.refreshIfExpiringWithin.

Refreshes the authentication data used by the provider if the token is expiring within the provided duration and allows to enable/disable refresh of keys

Parameters
time:Duration

the duration to check

refreshKeys:boolean

boolean value to enable/disable refresh of keys

Returns:String

the refreshed authentication data

Annotations
@Override
refreshSecurityTokenback to summary
public String refreshSecurityToken()

Deprecated

use refresh() instead

Refreshes the authentication data used by the provider

Returns:String

the refreshed authentication data

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

public Class InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

extends AbstractFederationClientAuthenticationDetailsProviderBuilder<InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder, InstancePrincipalsAuthenticationDetailsProvider>
Class Inheritance

Builder for InstancePrincipalsAuthenticationDetailsProviderBuilder.

Field Summary

Inherited from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder:
AUTHORIZATION_HEADER_VALUEcircuitBreakerConfigurationdetectEndpointRetriesfederationEndpointleafCertificateSupplierMETADATA_BASE_URL_ENV_VARMETADATA_SERVICE_BASE_URLMETADATA_URL_OVERRIDEmetadataBaseUrlregionSERVICEtenancyIdtimeoutForEachRetry

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public InstancePrincipalsAuthenticationDetailsProvider
build()

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.build.

Build a new AuthenticationDetailsProvider that uses the FederationClient.

protected InstancePrincipalsAuthenticationDetailsProvider
buildProvider(SessionKeySupplier
the session key supplier to use
sessionKeySupplierToUse
)

Implements abstract com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.buildProvider.

Build the actual provider.

public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder
detectEndpointRetries(int
the number of retries
detectEndpointRetries
)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.detectEndpointRetries.

Configures the custom retries to use for detecting endpoint.

public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder
federationEndpoint(String
the federation endpoint
federationEndpoint
)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.federationEndpoint.

Configures the custom federationEndpoint to use.

public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder
public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder
timeoutForEachRetry(int
the custom timeout
timeoutForEachRetry
)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.timeoutForEachRetry.

Configures the custom timeout for each retry to use for detecting endpoint.

Inherited from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder:
autoDetectCertificatesUsingMetadataUrlautoDetectEndpointUsingMetadataUrlautoDetectUsingMetadataUrlcircuitBreakerConfiguratorcreateFederationClientgetFederationEndpointgetLeafCertificateSuppliergetMetadataBaseUrlgetRegiongetTenancyIdmetadataBaseUrlpurposetenancyId

Constructor Detail

InstancePrincipalsAuthenticationDetailsProviderBuilderback to summary
public InstancePrincipalsAuthenticationDetailsProviderBuilder()

Method Detail

buildback to summary
public InstancePrincipalsAuthenticationDetailsProvider build()

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.build.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.build.

Build a new AuthenticationDetailsProvider that uses the FederationClient.

Returns:InstancePrincipalsAuthenticationDetailsProvider

A new provider instance.

Annotations
@Override
buildProviderback to summary
protected InstancePrincipalsAuthenticationDetailsProvider buildProvider(SessionKeySupplier sessionKeySupplierToUse)

Implements abstract com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.buildProvider.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.buildProvider.

Build the actual provider.

Parameters
sessionKeySupplierToUse:SessionKeySupplier

the session key supplier to use

Returns:InstancePrincipalsAuthenticationDetailsProvider

authentication details provider

Annotations
@Override
detectEndpointRetriesback to summary
public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder detectEndpointRetries(int detectEndpointRetries)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.detectEndpointRetries.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.detectEndpointRetries.

Configures the custom retries to use for detecting endpoint.

Parameters
detectEndpointRetries:int

the number of retries

Returns:InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

this builder

Annotations
@Override
federationEndpointback to summary
public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder federationEndpoint(String federationEndpoint)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.federationEndpoint.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.federationEndpoint.

Configures the custom federationEndpoint to use.

Parameters
federationEndpoint:String

the federation endpoint

Returns:InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

this builder

Annotations
@Override
leafCertificateSupplierback to summary
public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder leafCertificateSupplier(X509CertificateSupplier leafCertificateSupplier)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.leafCertificateSupplier.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.leafCertificateSupplier.

Configures the custom leafCertificateSupplier to use.

Returns:InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

this builder

Annotations
@Override
timeoutForEachRetryback to summary
public InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder timeoutForEachRetry(int timeoutForEachRetry)

Overrides com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.timeoutForEachRetry.

Doc from com.oracle.bmc.auth.AbstractFederationClientAuthenticationDetailsProviderBuilder.timeoutForEachRetry.

Configures the custom timeout for each retry to use for detecting endpoint.

Parameters
timeoutForEachRetry:int

the custom timeout

Returns:InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder

this builder

Annotations
@Override