public class BasicNativeSamlCredentialsProvider extends BrowserSamlCredentialsProvider
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
IAM_HTTP_URL_PATTERN |
protected static Pattern |
IAM_URL_PATTERN |
static String |
KEY_SAML_ASSERTION
Here we are defining a new connection property key called "saml_assertion".
|
protected static String |
KEY_SSL_INSECURE |
protected RedshiftLogger |
m_log |
protected boolean |
m_sslInsecure |
KEY_IDP_RESPONSE_TIMEOUT, KEY_LISTEN_PORT, KEY_LOGIN_URLKEY_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 and Description |
|---|
BasicNativeSamlCredentialsProvider()
Optional default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String key,
String value)
This method is used to get the values associated with different connection string properties.
|
protected CloseableHttpClient |
getHttpClient() |
protected static String |
getRegexForJsonKey(String keyName) |
protected String |
getSamlAssertion()
This method needs to return the SAML assertion string returned by the specific SAML provider
being used for this implementation.
|
protected void |
validateURL(String paramString) |
getPluginSpecificCacheKeycheckRequiredParameters, escapeHtmlEntity, getCacheKey, getCredentials, getFormAction, getIdpToken, getInputTagsfromHTML, getSubType, getValueByKey, getValueByKeyWithoutQuotesAndValueInSingleQuote, isPassword, isText, refresh, setGroupFederation, setLoggerpublic static final String KEY_SAML_ASSERTION
This means that a user wanting to use this credential provider may include the following in the connection string:
jdbc:redshift:iam://[host]:[port]/[database]?saml_assertion=[value]
If your implementation requires user input through the connection string, this is how you can define the connection property name. You can add as many new connection properties as needed following the same pattern:
public static final String PROPERTY_NAME = "key_name";
The restrictions on "key_name" are:
- The name must be unique. It can not match any existing connection property key name in the Redshift JDBC driver. The connection property names are case-insensitive, so even if the case does not match what is found in the documentation, it is not allowed.
- The key name may not have any spaces.
- The key name may only contain the characters [a-z]|[A-Z] or underscore '_'.
protected static final String KEY_SSL_INSECURE
protected boolean m_sslInsecure
protected static final Pattern IAM_URL_PATTERN
protected static final Pattern IAM_HTTP_URL_PATTERN
protected RedshiftLogger m_log
public BasicNativeSamlCredentialsProvider()
public void addParameter(String key, String value)
We override it in this custom credentials provider to add a check for any additional connection properties that were added, which are not included in the existing Redshift JDBC driver. It allows us to store these values using the appropriate fields as mentioned above.
For any new connection property keys added to this class, add an if-condition to check, if the current key matches the connection property key, store the value associated with the key in the appropriate field.
If no new connection property keys are required, you may leave the implementation blank and simply return a call to the parent class implementation.
Please see the example below.
addParameter in interface IPluginaddParameter in class BrowserSamlCredentialsProviderkey - A string representing the connection property key.value - The value associated with the connection property key.protected String getSamlAssertion() throws IOException
This will be used by the SamlCredentialsProvider parent class to get the temporary credentials.
getSamlAssertion in class BrowserSamlCredentialsProviderIOException - no error as such. It's an overridden method.protected CloseableHttpClient getHttpClient()
throws GeneralSecurityException
GeneralSecurityExceptionprotected void validateURL(String paramString) throws IOException
IOExceptionCopyright © 2024 Amazon.com Inc.. All rights reserved.