Top Description Methods
com.oracle.bmc.auth

public Interface ConfigurableRefreshOnNotAuthenticatedProvider<T>

Known Direct Implementers
com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider, com.oracle.bmc.auth.ResourcePrincipalAuthenticationDetailsProvider
Type Parameters
<T>
The type of authentication data held by the provider (e.g. for security tokens this could be a string)
Imports
java.time.Duration

For authentication providers with refreshable authentication data (e.g. those which wrap a security token received from a remote service), this interface flags that when a caller receives a NotAuthenticated error (HTTP 401) that they can refresh the authentication data and retry their request.

Consistent HTTP 401s would indicate that there is potentially an issue outside the issued token, so only making a single retry is suggested.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the refreshed authentication data
refreshIfExpiringWithin
(Duration
the duration to check
time
)

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

public T

Returns:

the refreshed authentication data
refreshIfExpiringWithin
(Duration
the duration to check
time
,
boolean
boolean value to enable/disable refresh of keys
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 keys

Method Detail

refreshIfExpiringWithinback to summary
public T refreshIfExpiringWithin(Duration time)

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:T

the refreshed authentication data

refreshIfExpiringWithinback to summary
public T 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 keys

Parameters
time:Duration

the duration to check

refreshKeys:boolean

boolean value to enable/disable refresh of keys

Returns:T

the refreshed authentication data