Package com.oracle.bmc.auth
Class InstancePrincipalsAuthenticationDetailsProvider
- java.lang.Object
-
- com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider
-
- com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider
-
- All Implemented Interfaces:
AbstractAuthenticationDetailsProvider,BasicAuthenticationDetailsProvider,ConfigurableRefreshOnNotAuthenticatedProvider<String>,RefreshableOnNotAuthenticatedProvider<String>,RegionProvider
public class InstancePrincipalsAuthenticationDetailsProvider extends AbstractRequestingAuthenticationDetailsProvider implements RegionProvider, RefreshableOnNotAuthenticatedProvider<String>, ConfigurableRefreshOnNotAuthenticatedProvider<String>
Implementation ofBasicAuthenticationDetailsProviderthat integrates with instance principal authentication endpoints to generate service tokens used for actual signing.Also uses
AuthCachingPolicyto disable caching (as the values for signing requests may be rotated periodically).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilderBuilder for InstancePrincipalsAuthenticationDetailsProviderBuilder.-
Nested classes/interfaces inherited from class com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider
AbstractRequestingAuthenticationDetailsProvider.Builder<B extends AbstractRequestingAuthenticationDetailsProvider.Builder<B>>, AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier
-
-
Field Summary
-
Fields inherited from class com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider
federationClient, sessionKeySupplier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilderbuilder()Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.RegiongetRegion()Returns the region.Stringrefresh()Refreshes the authentication data used by the providerStringrefreshIfExpiringWithin(Duration time)Refreshes the authentication data used by the provider if the token is expiring within the provided durationStringrefreshIfExpiringWithin(Duration time, boolean refreshKeys)Refreshes the authentication data used by the provider if the token is expiring within the provided duration and allows to enable/disable refresh of keysStringrefreshSecurityToken()Deprecated.userefresh()instead-
Methods inherited from class com.oracle.bmc.auth.AbstractRequestingAuthenticationDetailsProvider
getKeyId, getPassPhrase, getPassphraseCharacters, getPrivateKey
-
-
-
-
Method Detail
-
builder
public static InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder builder()
Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.- Returns:
- A new builder instance.
-
refreshSecurityToken
@Deprecated public String refreshSecurityToken()
Deprecated.userefresh()insteadRefreshes the authentication data used by the provider- Returns:
- the refreshed authentication data
-
refresh
public String refresh()
Description copied from interface:RefreshableOnNotAuthenticatedProviderRefreshes the authentication data used by the provider- Specified by:
refreshin interfaceRefreshableOnNotAuthenticatedProvider<String>- Returns:
- the refreshed authentication data
-
refreshIfExpiringWithin
public String refreshIfExpiringWithin(Duration time)
Description copied from interface:ConfigurableRefreshOnNotAuthenticatedProviderRefreshes the authentication data used by the provider if the token is expiring within the provided duration- Specified by:
refreshIfExpiringWithinin interfaceConfigurableRefreshOnNotAuthenticatedProvider<String>- Parameters:
time- the duration to check- Returns:
- the refreshed authentication data
-
refreshIfExpiringWithin
public String refreshIfExpiringWithin(Duration time, boolean refreshKeys)
Description copied from interface:ConfigurableRefreshOnNotAuthenticatedProviderRefreshes the authentication data used by the provider if the token is expiring within the provided duration and allows to enable/disable refresh of keys- Specified by:
refreshIfExpiringWithinin interfaceConfigurableRefreshOnNotAuthenticatedProvider<String>- Parameters:
time- the duration to checkrefreshKeys- boolean value to enable/disable refresh of keys- Returns:
- the refreshed authentication data
-
getRegion
public Region getRegion()
Description copied from interface:RegionProviderReturns the region.- Specified by:
getRegionin interfaceRegionProvider- Returns:
- Region object.
-
-