com.amazon.redshift.plugin

## Class BasicJwtCredentialsProvider

- java.lang.Object
- - com.amazon.redshift.plugin.JwtCredentialsProvider
  - - com.amazon.redshift.plugin.BasicJwtCredentialsProvider

All Implemented Interfaces:
  INativePlugin

    public class BasicJwtCredentialsProvider
    extends JwtCredentialsProvider

A basic JWT credential provider class. This class can be changed and implemented to work with any desired JWT service provider.

### 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.JwtCredentialsProvider

`m_disableCache`

### Constructor Summary

Constructors
Constructor and Description
`BasicJwtCredentialsProvider()` Optional default constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addParameter(String key, String value)`
`protected CloseableHttpClient` `getHttpClient()`
`protected String` `getJwtAssertion()` This method needs to return the JWT string returned by the specific JWT provider being used for this implementation.
`String` `getPluginSpecificCacheKey()`
`protected static String` `getRegexForJsonKey(String keyName)`
`protected void` `validateURL(String paramString)`

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

`getCacheKey, getCredentials, getIdpToken, isNullOrEmpty, refresh, setLogger`

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

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

### Methods inherited from interface com.amazon.redshift.INativePlugin

`isUsingIdentityEnhancedCredentials`

### 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

#### BasicJwtCredentialsProvider

    public BasicJwtCredentialsProvider()

Optional default constructor.

### Method Detail

#### getPluginSpecificCacheKey

    public String getPluginSpecificCacheKey()

Specified by:
  `getPluginSpecificCacheKey` in interface `INativePlugin`
Overrides:
  `getPluginSpecificCacheKey` in class `JwtCredentialsProvider`

#### addParameter

    public void addParameter(String key,
                             String value)

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

#### getJwtAssertion

    protected String getJwtAssertion()
                              throws IOException

This method needs to return the JWT string returned by the specific JWT provider being used for this implementation. How you get this string will depend on the specific JWT provider you are using. This method can decode jwt and process any custom claim/tag in it.

This will be used by the JwtCredentialsProvider parent class to get the temporary credentials.

Specified by:
  `getJwtAssertion` in class `JwtCredentialsProvider`
Returns:
  The JWT string.
Throws:
  `IOException` - throws exception when required parameters are missing.

#### 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)