public class ConfigFileAuthenticationDetailsProvider extends Object implements AuthenticationDetailsProvider, RegionProvider, ProvidesClientConfigurators
Implementation of AuthenticationDetailsProvider that uses a standard OCI configuration
file as an input.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileInstancePrincipalAuthenticationDetailsProvider |
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileResourcePrincipalAuthenticationDetailsProvider |
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileSimpleAuthenticationDetailsProvider |
| Modifier and Type | Field and Description |
|---|---|
protected BasicConfigFileAuthenticationProvider |
delegate |
| Constructor and Description |
|---|
ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.
|
ConfigFileAuthenticationDetailsProvider(String profile)
Creates a new instance using the config file at the default location, see
ConfigFileReader.DEFAULT_FILE_PATH. |
ConfigFileAuthenticationDetailsProvider(String configurationFilePath,
String profile)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
List<ClientConfigurator> |
getClientConfigurators() |
String |
getFingerprint()
Returns the fingerprint of the key being used.
|
String |
getKeyId()
Returns the keyId used to sign requests.
|
String |
getPassPhrase()
Deprecated.
|
char[] |
getPassphraseCharacters()
Returns the optional pass phrase for the (encrypted) private key, as a character array.
|
String |
getPemFilePath()
Returns the file path to the private key.
|
InputStream |
getPrivateKey()
Returns a new InputStream to the private key.
|
Region |
getRegion()
Returns the region.
|
static Region |
getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile) |
String |
getTenantId()
Returns the tenant OCID.
|
String |
getUserId()
Returns the user OCID.
|
String |
toString() |
protected final BasicConfigFileAuthenticationProvider delegate
public ConfigFileAuthenticationDetailsProvider(String profile) throws IOException
Creates a new instance using the config file at the default location, see ConfigFileReader.DEFAULT_FILE_PATH.
profile - profile to load, optionalIOException - if the configuration file could not be loadedpublic ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile) throws IOException
Creates a new instance.
configurationFilePath - path to the OCI configuration fileprofile - profile to load, optionalIOException - if the configuration file could not be loadedpublic ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.
configFile - The configuration file to use.public static Region getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile)
public String getFingerprint()
AuthenticationDetailsProviderReturns the fingerprint of the key being used.
getFingerprint in interface AuthenticationDetailsProviderpublic String getTenantId()
AuthenticationDetailsProviderReturns the tenant OCID.
getTenantId in interface AuthenticationDetailsProviderpublic String getUserId()
AuthenticationDetailsProviderReturns the user OCID.
getUserId in interface AuthenticationDetailsProviderpublic List<ClientConfigurator> getClientConfigurators()
getClientConfigurators in interface ProvidesClientConfigurators@Deprecated public String getPassPhrase()
BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key.
getPassPhrase in interface BasicAuthenticationDetailsProviderpublic char[] getPassphraseCharacters()
BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key, as a character array.
getPassphraseCharacters in interface BasicAuthenticationDetailsProviderpublic InputStream getPrivateKey()
BasicAuthenticationDetailsProviderReturns a new InputStream to the private key. This stream should be closed by the caller, implementations should return new streams each time.
getPrivateKey in interface BasicAuthenticationDetailsProviderpublic String getKeyId()
BasicAuthenticationDetailsProviderReturns the keyId used to sign requests.
getKeyId in interface BasicAuthenticationDetailsProviderpublic Region getRegion()
RegionProviderReturns the region.
getRegion in interface RegionProviderpublic String getPemFilePath()
Returns the file path to the private key.
Copyright © 2016–2024. All rights reserved.