com.amazon.redshift.plugin

## Class IdpTokenAuthPlugin

- java.lang.Object
- - com.amazon.redshift.plugin.CommonCredentialsProvider
  - - com.amazon.redshift.plugin.IdpTokenAuthPlugin

All Implemented Interfaces:
  INativePlugin

    public class IdpTokenAuthPlugin
    extends CommonCredentialsProvider

A basic credential provider class. This plugin class allows clients to directly provide any auth token that is handled by Redshift. It supports two authentication flows: 1. Direct token flow: token_type and token parameters 2. Identity-enhanced credentials flow: AccessKeyID, SecretAccessKey, and SessionToken parameters

### Field Summary

Fields
`protected static Pattern` `IAM_HTTP_URL_PATTERN`
`protected static Pattern` `IAM_URL_PATTERN`
`protected static String` `KEY_SSL_INSECURE`
`protected RedshiftLogger` `m_log`
`protected boolean` `m_sslInsecure`

### Fields inherited from class com.amazon.redshift.plugin.CommonCredentialsProvider

`m_disableCache`

### Constructor Summary

Constructors
Constructor and Description
`IdpTokenAuthPlugin()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addParameter(String key, String value)`
`protected NativeTokenHolder` `getAuthToken()` This overridden method needs to return the auth token provided by the client
`protected CloseableHttpClient` `getHttpClient()`
`protected static String` `getRegexForJsonKey(String keyName)`
`boolean` `isUsingIdentityEnhancedCredentials()` Check if this plugin is using identity-enhanced credentials (IAM credentials with IdC context) Note that this function is not actually checking to see if the credentials themselves are identity enhanced, it is just checking to see if they have the necessary parameters of access key, secret access key, and session token provided
`protected void` `validateURL(String paramString)`

### Methods inherited from class com.amazon.redshift.plugin.CommonCredentialsProvider

`getCacheKey, getCredentials, getIdpToken, getPluginSpecificCacheKey, refresh, setLogger`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### KEY_SSL_INSECURE

    protected static final String KEY_SSL_INSECURE

See Also:
  Constant Field Values

#### m_sslInsecure

    protected boolean m_sslInsecure

#### IAM_URL_PATTERN

    protected static final Pattern IAM_URL_PATTERN

#### IAM_HTTP_URL_PATTERN

    protected static final Pattern IAM_HTTP_URL_PATTERN

#### m_log

    protected RedshiftLogger m_log

### Constructor Detail

#### IdpTokenAuthPlugin

    public IdpTokenAuthPlugin()

### Method Detail

#### getAuthToken

    protected NativeTokenHolder getAuthToken()
                                      throws IOException

This overridden method needs to return the auth token provided by the client

Specified by:
  `getAuthToken` in class `CommonCredentialsProvider`
Returns:
  `NativeTokenHolder` A wrapper containing auth token and its expiration time information
Throws:
  `IOException` - indicating that some required parameter is missing.

#### addParameter

    public void addParameter(String key,
                             String value)

Specified by:
  `addParameter` in interface `INativePlugin`
Overrides:
  `addParameter` in class `CommonCredentialsProvider`

#### isUsingIdentityEnhancedCredentials

    public boolean isUsingIdentityEnhancedCredentials()

Check if this plugin is using identity-enhanced credentials (IAM credentials with IdC context) Note that this function is not actually checking to see if the credentials themselves are identity enhanced, it is just checking to see if they have the necessary parameters of access key, secret access key, and session token provided

Returns:
  true if using identity-enhanced credentials, false if using direct token

#### getHttpClient

    protected CloseableHttpClient getHttpClient()
                                         throws GeneralSecurityException

Throws:
  `GeneralSecurityException`

#### validateURL

    protected void validateURL(String paramString)
                        throws IOException

Throws:
  `IOException`

#### getRegexForJsonKey

    protected static String getRegexForJsonKey(String keyName)