Class SamlServiceProvider.Builder
java.lang.Object
com.revetsec.saml.SamlServiceProvider.Builder
- Enclosing class:
SamlServiceProvider
@NotThreadSafe
@CheckReturnValue
public static final class SamlServiceProvider.Builder
extends Object
Mutable configuration before creating an immutable SP.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionAcknowledges that this JVM globally disables XML-signature secure validation.Configures this option.build()Returns this value.Configures this option.Configures this option.Configures decryption credentials, including rollover keys.maximumResponseAge(@Nullable Duration value) Configures this option.observer(@Nullable SamlObserver value) Configures redacted caller-thread SAML events; null restores the disabled observer.Configures this option.Configures the public SP HTTP-POST logout receiver.random(@Nullable SecureRandom value) Configures this option.replayBudget(@Nullable Duration value) Configures this option.replayCache(@Nullable SamlReplayCache value) Configures this option.Configures a signing key and certificate for requests and metadata.signingPrivateKey(@Nullable PrivateKey value) Configures this option.singleLogoutServiceUrl(@Nullable URI value) Configures the public SP HTTP-Redirect logout receiver.
-
Method Details
-
assertionConsumerServiceUrl
@CheckReturnValue public @NonNull SamlServiceProvider.Builder assertionConsumerServiceUrl(@Nullable URI value) Configures this option.- Parameters:
value- HTTPS ACS URL, at most 2048 characters in ASCII URI form- Returns:
- this builder
- Since:
- 1.0.0
-
singleLogoutServiceUrl
@CheckReturnValue public @NonNull SamlServiceProvider.Builder singleLogoutServiceUrl(@Nullable URI value) Configures the public SP HTTP-Redirect logout receiver.- Parameters:
value- HTTPS logout URI of at most 2048 ASCII URI characters, or null to disable Redirect logout- Returns:
- this builder
- Since:
- 1.0.0
-
postSingleLogoutServiceUrl
@CheckReturnValue public @NonNull SamlServiceProvider.Builder postSingleLogoutServiceUrl(@Nullable URI value) Configures the public SP HTTP-POST logout receiver.- Parameters:
value- HTTPS logout URI of at most 2048 ASCII URI characters, or null to disable POST logout- Returns:
- this builder
- Since:
- 1.0.0
-
replayCache
@CheckReturnValue public @NonNull SamlServiceProvider.Builder replayCache(@Nullable SamlReplayCache value) Configures this option.- Parameters:
value- explicitly selected replay cache- Returns:
- this builder
- Since:
- 1.0.0
-
signingPrivateKey
@CheckReturnValue public @NonNull SamlServiceProvider.Builder signingPrivateKey(@Nullable PrivateKey value) Configures this option.- Parameters:
value- optional RSA signing key for authentication and logout messages- Returns:
- this builder
- Since:
- 1.0.0
-
signingCredential
@CheckReturnValue public @NonNull SamlServiceProvider.Builder signingCredential(@Nullable SamlCredential value) Configures a signing key and certificate for requests and metadata.- Parameters:
value- signing credential, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
decryptionCredentials
@CheckReturnValue public @NonNull SamlServiceProvider.Builder decryptionCredentials(@Nullable List<@NonNull SamlCredential> value) Configures decryption credentials, including rollover keys.- Parameters:
value- credentials, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
clock
Configures this option.- Parameters:
value- validation clock, or null to reset to system UTC- Returns:
- this builder
- Since:
- 1.0.0
-
random
Configures this option.- Parameters:
value- cryptographic random source, or null for a new default- Returns:
- this builder
- Since:
- 1.0.0
-
clockSkew
Configures this option.- Parameters:
value- skew from zero to five minutes, or null for three minutes- Returns:
- this builder
- Since:
- 1.0.0
-
maximumResponseAge
@CheckReturnValue public @NonNull SamlServiceProvider.Builder maximumResponseAge(@Nullable Duration value) Configures this option.- Parameters:
value- assertion age from one second to fifteen minutes, or null for five minutes- Returns:
- this builder
- Since:
- 1.0.0
-
pendingAuthenticationLifetime
@CheckReturnValue public @NonNull SamlServiceProvider.Builder pendingAuthenticationLifetime(@Nullable Duration value) Configures this option.- Parameters:
value- pending lifetime from one second to fifteen minutes, or null for five minutes- Returns:
- this builder
- Since:
- 1.0.0
-
replayBudget
@CheckReturnValue public @NonNull SamlServiceProvider.Builder replayBudget(@Nullable Duration value) Configures this option.- Parameters:
value- replay operation budget from one millisecond to thirty seconds- Returns:
- this builder
- Since:
- 1.0.0
-
observer
@CheckReturnValue public @NonNull SamlServiceProvider.Builder observer(@Nullable SamlObserver value) Configures redacted caller-thread SAML events; null restores the disabled observer.- Parameters:
value- observer, or null to disable events- Returns:
- this builder
- Since:
- 1.0.0
-
acknowledgeGlobalSecureValidationDisabled
@CheckReturnValue public @NonNull SamlServiceProvider.Builder acknowledgeGlobalSecureValidationDisabled(@Nullable Boolean value) Acknowledges that this JVM globally disables XML-signature secure validation. Revetsec still sets secure validation on each verification context and enforces its own signature shape and algorithm allowlists. The setting is reported to the observer at build time.- Parameters:
value- true to acknowledge; false or null restores the safe default- Returns:
- this builder
- Since:
- 1.0.0
-
build
Returns this value.- Returns:
- immutable SP configuration
- Since:
- 1.0.0
-