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 ofBasicAuthenticationDetailsProvider
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 Class Summary
Nested Classes Modifier and Type Class Description static class
InstancePrincipalsAuthenticationDetailsProvider.InstancePrincipalsAuthenticationDetailsProviderBuilder
Builder 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.InstancePrincipalsAuthenticationDetailsProviderBuilder
builder()
Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.Region
getRegion()
Returns the region.String
refresh()
Refreshes the authentication data used by the providerString
refreshIfExpiringWithin(Duration time)
Refreshes the authentication data used by the provider if the token is expiring within the provided durationString
refreshIfExpiringWithin(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 keysString
refreshSecurityToken()
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:RefreshableOnNotAuthenticatedProvider
Refreshes the authentication data used by the provider- Specified by:
refresh
in interfaceRefreshableOnNotAuthenticatedProvider<String>
- Returns:
- the refreshed authentication data
-
refreshIfExpiringWithin
public String refreshIfExpiringWithin(Duration time)
Description copied from interface:ConfigurableRefreshOnNotAuthenticatedProvider
Refreshes the authentication data used by the provider if the token is expiring within the provided duration- Specified by:
refreshIfExpiringWithin
in 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:ConfigurableRefreshOnNotAuthenticatedProvider
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- Specified by:
refreshIfExpiringWithin
in 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:RegionProvider
Returns the region.- Specified by:
getRegion
in interfaceRegionProvider
- Returns:
- Region object.
-
-