Package com.volcengine.auth
Class SamlCredentialProvider
- java.lang.Object
-
- com.volcengine.auth.SamlCredentialProvider
-
- All Implemented Interfaces:
Provider
public class SamlCredentialProvider extends Object implements Provider
Provider that obtains temporary credentials via STS AssumeRoleWithSAML.Follows the
ProviderCQS contract:isExpired()/retrieve()are pure reads.refresh()is the only method that mutates state.
Intended to be wrapped in a
CredentialProvider, which serializes refresh through aReadWriteLockand guarantees theisExpired → refresh → retrievesequence. Direct use (without wrapping) is not a supported mode.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisExpired()voidrefresh()CredentialValueretrieve()voidsetDurationSeconds(int durationSeconds)voidsetExpireBufferSeconds(int expireBufferSeconds)voidsetMaxRetries(int maxRetries)voidsetRetryIntervalMs(int retryIntervalMs)voidsetSchema(String schema)
-
-
-
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/YourRoleNamesamlProviderTrn- the TRN of the SAML provider, e.g.trn:iam::1234567890:saml-provider/MyIdpsamlAssertion- the base64-encoded SAML Response from your IdProlePolicy- optional inline policy to restrict permissions (may be null)stsEndpoint- optional STS endpoint override (may be null for default)
-
-
Method Detail
-
refresh
public void refresh() throws ApiException- Specified by:
refreshin interfaceProvider- Throws:
ApiException
-
retrieve
public CredentialValue retrieve() throws ApiException
- Specified by:
retrievein interfaceProvider- Throws:
ApiException
-
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)
-
-