Class SamlCredentialProvider

  • All Implemented Interfaces:
    Provider

    public class SamlCredentialProvider
    extends Object
    implements Provider
    Provider that obtains temporary credentials via STS AssumeRoleWithSAML.

    Follows the Provider CQS contract:

    Intended to be wrapped in a CredentialProvider, which serializes refresh through a ReadWriteLock and guarantees the isExpired → refresh → retrieve sequence. Direct use (without wrapping) is not a supported mode.

    • Constructor Detail

      • SamlCredentialProvider

        public SamlCredentialProvider​(String roleTrn,
                                      String samlProviderTrn,
                                      String samlAssertion,
                                      String rolePolicy,
                                      String stsEndpoint)
        Creates a new SamlCredentialProvider.
        Parameters:
        roleTrn - the TRN of the role to assume, e.g. trn:iam::1234567890:role/YourRoleName
        samlProviderTrn - the TRN of the SAML provider, e.g. trn:iam::1234567890:saml-provider/MyIdp
        samlAssertion - the base64-encoded SAML Response from your IdP
        rolePolicy - optional inline policy to restrict permissions (may be null)
        stsEndpoint - optional STS endpoint override (may be null for default)
    • Method Detail

      • isExpired

        public boolean isExpired()
        Specified by:
        isExpired in interface Provider
      • setDurationSeconds

        public void setDurationSeconds​(int durationSeconds)
      • setExpireBufferSeconds

        public void setExpireBufferSeconds​(int expireBufferSeconds)
      • setSchema

        public void setSchema​(String schema)
      • setMaxRetries

        public void setMaxRetries​(int maxRetries)
      • setRetryIntervalMs

        public void setRetryIntervalMs​(int retryIntervalMs)