com.amazon.redshift.plugin

## Class SamlCredentialsProvider

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

All Implemented Interfaces:
  IPlugin

Direct Known Subclasses:
  AdfsCredentialsProvider, AzureCredentialsProvider, BasicSamlCredentialsProvider, BrowserAzureCredentialsProvider, BrowserSamlCredentialsProvider, OktaCredentialsProvider, PingCredentialsProvider

    public abstract class SamlCredentialsProvider
    extends Object
    implements IPlugin

### Field Summary

Fields
`protected static Pattern` `IAM_HTTP_URL_PATTERN`
`protected static Pattern` `IAM_URL_PATTERN`
`protected static String` `KEY_IDP_HOST`
`protected static String` `KEY_SSL_INSECURE`
`protected Boolean` `m_autoCreate`
`protected String` `m_dbGroups`
`protected String` `m_dbGroupsFilter`
`protected String` `m_dbUser`
`protected Boolean` `m_disableCache`
`protected int` `m_duration`
`protected Boolean` `m_forceLowercase`
`protected Boolean` `m_groupFederation`
`protected String` `m_idpHost`
`protected int` `m_idpPort`
`protected RedshiftLogger` `m_log`
`protected String` `m_password`
`protected String` `m_preferredRole`
`protected String` `m_region`
`protected boolean` `m_sslInsecure`
`protected String` `m_stsEndpoint`
`protected String` `m_userName`

### Constructor Summary

Constructors
Constructor and Description
`SamlCredentialsProvider()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `addParameter(String key, String value)`
`protected void` `checkRequiredParameters()`
`protected String` `escapeHtmlEntity(String html)` Escape certain HTML entities for the given input string.
`String` `getCacheKey()`
`CredentialsHolder` `getCredentials()`
`protected String` `getFormAction(String body)`
`protected CloseableHttpClient` `getHttpClient()`
`String` `getIdpToken()`
`protected List<String>` `getInputTagsfromHTML(String body)`
`String` `getPluginSpecificCacheKey()`
`protected abstract String` `getSamlAssertion()`
`int` `getSubType()`
`protected String` `getValueByKey(String input, String key)`
`protected String` `getValueByKeyWithoutQuotesAndValueInSingleQuote(String input, String key)`
`protected boolean` `isPassword(String inputTag)`
`protected boolean` `isText(String inputTag)`
`void` `refresh()`
`void` `setGroupFederation(boolean groupFederation)`
`void` `setLogger(RedshiftLogger log)`
`protected void` `validateURL(String paramString)`

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

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

### Field Detail

#### KEY_IDP_HOST

    protected static final String KEY_IDP_HOST

See Also:
  Constant Field Values

#### m_userName

    protected String m_userName

#### m_password

    protected String m_password

#### m_idpHost

    protected String m_idpHost

#### m_idpPort

    protected int m_idpPort

#### m_duration

    protected int m_duration

#### m_preferredRole

    protected String m_preferredRole

#### m_dbUser

    protected String m_dbUser

#### m_dbGroups

    protected String m_dbGroups

#### m_dbGroupsFilter

    protected String m_dbGroupsFilter

#### m_forceLowercase

    protected Boolean m_forceLowercase

#### m_autoCreate

    protected Boolean m_autoCreate

#### m_stsEndpoint

    protected String m_stsEndpoint

#### m_region

    protected String m_region

#### m_disableCache

    protected Boolean m_disableCache

#### m_groupFederation

    protected Boolean m_groupFederation

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

#### SamlCredentialsProvider

    public SamlCredentialsProvider()

### Method Detail

#### getSamlAssertion

    protected abstract String getSamlAssertion()
                                        throws IOException

Throws:
  `IOException`

#### addParameter

    public void addParameter(String key,
                             String value)

Specified by:
  `addParameter` in interface `IPlugin`

#### setLogger

    public void setLogger(RedshiftLogger log)

Specified by:
  `setLogger` in interface `IPlugin`

#### getSubType

    public int getSubType()

Specified by:
  `getSubType` in interface `IPlugin`

#### getCredentials

    public CredentialsHolder getCredentials()

#### refresh

    public void refresh()

#### getPluginSpecificCacheKey

    public String getPluginSpecificCacheKey()

Specified by:
  `getPluginSpecificCacheKey` in interface `IPlugin`

#### getIdpToken

    public String getIdpToken()

Specified by:
  `getIdpToken` in interface `IPlugin`

#### setGroupFederation

    public void setGroupFederation(boolean groupFederation)

Specified by:
  `setGroupFederation` in interface `IPlugin`

#### getCacheKey

    public String getCacheKey()

Specified by:
  `getCacheKey` in interface `IPlugin`

#### getInputTagsfromHTML

    protected List<String> getInputTagsfromHTML(String body)

#### getFormAction

    protected String getFormAction(String body)

#### getValueByKey

    protected String getValueByKey(String input,
                                   String key)

#### getValueByKeyWithoutQuotesAndValueInSingleQuote

    protected String getValueByKeyWithoutQuotesAndValueInSingleQuote(String input,
                                                                     String key)

#### escapeHtmlEntity

    protected String escapeHtmlEntity(String html)

Escape certain HTML entities for the given input string.

Parameters:
  `html` - The string to escape.
Returns:
  The string with the special HTML entities escaped.

#### checkRequiredParameters

    protected void checkRequiredParameters()
                                    throws IOException

Throws:
  `IOException`

#### isText

    protected boolean isText(String inputTag)

#### isPassword

    protected boolean isPassword(String inputTag)

#### getHttpClient

    protected CloseableHttpClient getHttpClient()
                                         throws GeneralSecurityException

Throws:
  `GeneralSecurityException`

#### validateURL

    protected void validateURL(String paramString)
                        throws IOException

Throws:
  `IOException`