Package com.oracle.bmc.auth
Class ConfigFileAuthenticationDetailsProvider
- java.lang.Object
 - 
- com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider
 
 
- 
- All Implemented Interfaces:
 AbstractAuthenticationDetailsProvider,AuthenticationDetailsProvider,BasicAuthenticationDetailsProvider,ProvidesClientConfigurators,RegionProvider
public class ConfigFileAuthenticationDetailsProvider extends Object implements AuthenticationDetailsProvider, RegionProvider, ProvidesClientConfigurators
Implementation ofAuthenticationDetailsProviderthat uses a standard OCI configuration file as an input. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classConfigFileAuthenticationDetailsProvider.ConfigFileInstancePrincipalAuthenticationDetailsProviderprotected static classConfigFileAuthenticationDetailsProvider.ConfigFileResourcePrincipalAuthenticationDetailsProviderprotected static classConfigFileAuthenticationDetailsProvider.ConfigFileSimpleAuthenticationDetailsProvider 
- 
Field Summary
Fields Modifier and Type Field Description protected BasicConfigFileAuthenticationProviderdelegate 
- 
Constructor Summary
Constructors Constructor Description ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)Creates a new instance.ConfigFileAuthenticationDetailsProvider(String profile)Creates a new instance using the config file at the default location, seeConfigFileReader.DEFAULT_FILE_PATH.ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile)Creates a new instance. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<ClientConfigurator>getClientConfigurators()StringgetFingerprint()Returns the fingerprint of the key being used.StringgetKeyId()Returns the keyId used to sign requests.StringgetPassPhrase()Deprecated.char[]getPassphraseCharacters()Returns the optional pass phrase for the (encrypted) private key, as a character array.StringgetPemFilePath()Returns the file path to the private key.InputStreamgetPrivateKey()Returns a new InputStream to the private key.RegiongetRegion()Returns the region.static RegiongetRegionFromConfigFile(ConfigFileReader.ConfigFile configFile)StringgetTenantId()Returns the tenant OCID.StringgetUserId()Returns the user OCID.StringtoString() 
 - 
 
- 
- 
Field Detail
- 
delegate
protected final BasicConfigFileAuthenticationProvider delegate
 
 - 
 
- 
Constructor Detail
- 
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(String profile) throws IOException
Creates a new instance using the config file at the default location, seeConfigFileReader.DEFAULT_FILE_PATH.- Parameters:
 profile- profile to load, optional- Throws:
 IOException- if the configuration file could not be loaded
 
- 
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile) throws IOException
Creates a new instance.- Parameters:
 configurationFilePath- path to the OCI configuration fileprofile- profile to load, optional- Throws:
 IOException- if the configuration file could not be loaded
 
- 
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.- Parameters:
 configFile- The configuration file to use.
 
 - 
 
- 
Method Detail
- 
getRegionFromConfigFile
public static Region getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile)
 
- 
getFingerprint
public String getFingerprint()
Description copied from interface:AuthenticationDetailsProviderReturns the fingerprint of the key being used.- Specified by:
 getFingerprintin interfaceAuthenticationDetailsProvider- Returns:
 - The fingerprint.
 
 
- 
getTenantId
public String getTenantId()
Description copied from interface:AuthenticationDetailsProviderReturns the tenant OCID.- Specified by:
 getTenantIdin interfaceAuthenticationDetailsProvider- Returns:
 - The tenant OCID.
 
 
- 
getUserId
public String getUserId()
Description copied from interface:AuthenticationDetailsProviderReturns the user OCID.- Specified by:
 getUserIdin interfaceAuthenticationDetailsProvider- Returns:
 - The user OCID.
 
 
- 
getClientConfigurators
public List<ClientConfigurator> getClientConfigurators()
- Specified by:
 getClientConfiguratorsin interfaceProvidesClientConfigurators
 
- 
getPassPhrase
@Deprecated public String getPassPhrase()
Deprecated.Description copied from interface:BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key.- Specified by:
 getPassPhrasein interfaceBasicAuthenticationDetailsProvider- Returns:
 - The pass phrase, or null if not applicable
 
 
- 
getPassphraseCharacters
public char[] getPassphraseCharacters()
Description copied from interface:BasicAuthenticationDetailsProviderReturns the optional pass phrase for the (encrypted) private key, as a character array.- Specified by:
 getPassphraseCharactersin interfaceBasicAuthenticationDetailsProvider- Returns:
 - The pass phrase as character array, or null if not applicable
 
 
- 
getPrivateKey
public InputStream getPrivateKey()
Description copied from interface:BasicAuthenticationDetailsProviderReturns a new InputStream to the private key.This stream should be closed by the caller, implementations should return new streams each time.
- Specified by:
 getPrivateKeyin interfaceBasicAuthenticationDetailsProvider- Returns:
 - A new InputStream.
 
 
- 
getKeyId
public String getKeyId()
Description copied from interface:BasicAuthenticationDetailsProviderReturns the keyId used to sign requests.- Specified by:
 getKeyIdin interfaceBasicAuthenticationDetailsProvider- Returns:
 - The keyId.
 
 
- 
getRegion
public Region getRegion()
Description copied from interface:RegionProviderReturns the region.- Specified by:
 getRegionin interfaceRegionProvider- Returns:
 - Region object.
 
 
- 
getPemFilePath
public String getPemFilePath()
Returns the file path to the private key.- Returns:
 - the PEM File Path.
 
 
 - 
 
 -