com.amazon.redshift.plugin

## Class BrowserAzureCredentialsProvider

- java.lang.Object
- - com.amazon.redshift.plugin.SamlCredentialsProvider
  - - com.amazon.redshift.plugin.BrowserAzureCredentialsProvider

All Implemented Interfaces:
  IPlugin

    public class BrowserAzureCredentialsProvider
    extends SamlCredentialsProvider

Class to get SAML Token from any IDP using OAuth 2.0 API

### Field Summary

Fields
`protected static Pattern` `IAM_HTTP_URL_PATTERN`
`protected static Pattern` `IAM_URL_PATTERN`
`static String` `KEY_CLIENT_ID` Key for setting client ID.
`static String` `KEY_IDP_RESPONSE_TIMEOUT` Key for setting timeout for IDP response.
`static String` `KEY_IDP_TENANT` Key for setting idp tenant.
`static String` `KEY_LISTEN_PORT` Key for setting the port number for listening.
`protected static String` `KEY_SSL_INSECURE`
`protected RedshiftLogger` `m_log`
`protected boolean` `m_sslInsecure`
`static String` `OAUTH_CLIENT_ID_PARAMETER_NAME` Key for setting client ID.
`static String` `OAUTH_GRANT_TYPE_PARAMETER_NAME` Key for setting grant type.
`static String` `OAUTH_IDP_CODE_PARAMETER_NAME` Key for setting code.
`static String` `OAUTH_REDIRECT_PARAMETER_NAME` Key for setting redirect URI.
`static String` `OAUTH_REQUESTED_TOKEN_TYPE_PARAMETER_NAME` Key for setting requested token type.
`static String` `OAUTH_RESOURCE_PARAMETER_NAME` Key for setting resource.
`static String` `OAUTH_RESPONSE_MODE_PARAMETER_NAME` Key for setting response mode.
`static String` `OAUTH_RESPONSE_TYPE_PARAMETER_NAME` Key for setting OAUTH response type.
`static String` `OAUTH_SCOPE_PARAMETER_NAME` Key for setting scope.
`static String` `OAUTH_STATE_PARAMETER_NAME` Key for setting state.

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

`KEY_IDP_HOST, m_autoCreate, m_dbGroups, m_dbGroupsFilter, m_dbUser, m_disableCache, m_duration, m_forceLowercase, m_groupFederation, m_idpHost, m_idpPort, m_password, m_preferredRole, m_region, m_stsEndpoint, m_userName`

### Constructor Summary

Constructors
Constructor and Description
`BrowserAzureCredentialsProvider()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addParameter(String key, String value)` Overwritten method to grab the field parameters from JDBC connection string.
`protected CloseableHttpClient` `getHttpClient()`
`String` `getPluginSpecificCacheKey()`
`protected static String` `getRegexForJsonKey(String keyName)`
`protected String` `getSamlAssertion()` Overridden method to grab the SAML Response.
`protected void` `validateURL(String paramString)`

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

`checkRequiredParameters, escapeHtmlEntity, getCacheKey, getFormAction, getIdpToken, getInputTagsfromHTML, getSubType, getValueByKey, getValueByKeyWithoutQuotesAndValueInSingleQuote, isPassword, isText, refresh, resolveCredentials, setGroupFederation, setLogger`

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

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

### Field Detail

#### KEY_IDP_RESPONSE_TIMEOUT

    public static final String KEY_IDP_RESPONSE_TIMEOUT

Key for setting timeout for IDP response.

See Also:
  Constant Field Values

#### KEY_LISTEN_PORT

    public static final String KEY_LISTEN_PORT

Key for setting the port number for listening.

See Also:
  Constant Field Values

#### KEY_IDP_TENANT

    public static final String KEY_IDP_TENANT

Key for setting idp tenant.

See Also:
  Constant Field Values

#### KEY_CLIENT_ID

    public static final String KEY_CLIENT_ID

Key for setting client ID.

See Also:
  Constant Field Values

#### OAUTH_STATE_PARAMETER_NAME

    public static final String OAUTH_STATE_PARAMETER_NAME

Key for setting state.

See Also:
  Constant Field Values

#### OAUTH_REDIRECT_PARAMETER_NAME

    public static final String OAUTH_REDIRECT_PARAMETER_NAME

Key for setting redirect URI.

See Also:
  Constant Field Values

#### OAUTH_IDP_CODE_PARAMETER_NAME

    public static final String OAUTH_IDP_CODE_PARAMETER_NAME

Key for setting code.

See Also:
  Constant Field Values

#### OAUTH_CLIENT_ID_PARAMETER_NAME

    public static final String OAUTH_CLIENT_ID_PARAMETER_NAME

Key for setting client ID.

See Also:
  Constant Field Values

#### OAUTH_RESPONSE_TYPE_PARAMETER_NAME

    public static final String OAUTH_RESPONSE_TYPE_PARAMETER_NAME

Key for setting OAUTH response type.

See Also:
  Constant Field Values

#### OAUTH_REQUESTED_TOKEN_TYPE_PARAMETER_NAME

    public static final String OAUTH_REQUESTED_TOKEN_TYPE_PARAMETER_NAME

Key for setting requested token type.

See Also:
  Constant Field Values

#### OAUTH_GRANT_TYPE_PARAMETER_NAME

    public static final String OAUTH_GRANT_TYPE_PARAMETER_NAME

Key for setting grant type.

See Also:
  Constant Field Values

#### OAUTH_SCOPE_PARAMETER_NAME

    public static final String OAUTH_SCOPE_PARAMETER_NAME

Key for setting scope.

See Also:
  Constant Field Values

#### OAUTH_RESOURCE_PARAMETER_NAME

    public static final String OAUTH_RESOURCE_PARAMETER_NAME

Key for setting resource.

See Also:
  Constant Field Values

#### OAUTH_RESPONSE_MODE_PARAMETER_NAME

    public static final String OAUTH_RESPONSE_MODE_PARAMETER_NAME

Key for setting response mode.

See Also:
  Constant Field Values

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

#### BrowserAzureCredentialsProvider

    public BrowserAzureCredentialsProvider()

### Method Detail

#### getSamlAssertion

    protected String getSamlAssertion()
                               throws IOException

Overridden method to grab the SAML Response. Used in base class to refresh temporary credentials.

Specified by:
  `getSamlAssertion` in class `SamlCredentialsProvider`
Returns:
  Base64 encoded SAML Response string
Throws:
  `IOException` - indicating the error

#### addParameter

    public void addParameter(String key,
                             String value)

Overwritten method to grab the field parameters from JDBC connection string. This method calls the base class' addParameter method and adds to it new specific parameters.

Specified by:
  `addParameter` in interface `IPlugin`
Overrides:
  `addParameter` in class `SamlCredentialsProvider`
Parameters:
  `key` - parameter key passed to JDBC
  `value` - parameter value associated with the given key

#### getPluginSpecificCacheKey

    public String getPluginSpecificCacheKey()

Specified by:
  `getPluginSpecificCacheKey` in interface `IPlugin`
Overrides:
  `getPluginSpecificCacheKey` in class `SamlCredentialsProvider`

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