Class SamlIdentityProvider.Builder
java.lang.Object
com.revetsec.saml.SamlIdentityProvider.Builder
- Enclosing class:
SamlIdentityProvider
@NotThreadSafe
@CheckReturnValue
public static final class SamlIdentityProvider.Builder
extends Object
Configures one trusted IdP connection.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionEnables decrypting AES-CBC assertions only beneath a verified Response signature.Enables a separate IdP-initiated login operation for this connection.Sets exact approved scopes for SAML subject-id and pairwise-id attributes.build()Returns this value.Sets explicit compatibility modes for this one trusted IdP connection.connectionId(@Nullable String value) Configures this option.Configures a distinct HTTP-POST endpoint for LogoutResponse messages.postSingleLogoutService(@Nullable URI value) Configures the IdP's HTTP-POST Single Logout endpoint.postSingleSignOnService(@Nullable URI value) Configures this IdP's HTTP-POST AuthnRequest endpoint.Configures a distinct HTTP-Redirect endpoint for LogoutResponse messages.Configures the IdP's HTTP-Redirect Single Logout endpoint.Configures this option.Configures this option.signingKeys(@Nullable List<@NonNull PublicKey> value) Configures this option.Configures this option.
-
Method Details
-
connectionId
Configures this option.- Parameters:
value- application-unique nonempty namespace of at most 256 well-formed UTF-16 code units- Returns:
- this builder
- Since:
- 1.0.0
-
redirectSingleSignOnService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder redirectSingleSignOnService(@Nullable URI value) Configures this option.- Parameters:
value- HTTPS HTTP-Redirect SSO endpoint- Returns:
- this builder
- Since:
- 1.0.0
-
postSingleSignOnService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder postSingleSignOnService(@Nullable URI value) Configures this IdP's HTTP-POST AuthnRequest endpoint.- Parameters:
value- HTTPS endpoint, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
redirectSingleLogoutService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder redirectSingleLogoutService(@Nullable URI value) Configures the IdP's HTTP-Redirect Single Logout endpoint.- Parameters:
value- HTTPS endpoint, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
postSingleLogoutService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder postSingleLogoutService(@Nullable URI value) Configures the IdP's HTTP-POST Single Logout endpoint.- Parameters:
value- HTTPS endpoint, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
redirectSingleLogoutResponseService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder redirectSingleLogoutResponseService(@Nullable URI value) Configures a distinct HTTP-Redirect endpoint for LogoutResponse messages.- Parameters:
value- HTTPS ResponseLocation, or null to use the request endpoint- Returns:
- this builder
- Since:
- 1.0.0
-
postSingleLogoutResponseService
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder postSingleLogoutResponseService(@Nullable URI value) Configures a distinct HTTP-POST endpoint for LogoutResponse messages.- Parameters:
value- HTTPS ResponseLocation, or null to use the request endpoint- Returns:
- this builder
- Since:
- 1.0.0
-
signingKeys
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder signingKeys(@Nullable List<@NonNull PublicKey> value) Configures this option.- Parameters:
value- trusted current and rollover verification keys- Returns:
- this builder
- Since:
- 1.0.0
-
wantAuthnRequestsSigned
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder wantAuthnRequestsSigned(@Nullable Boolean value) Configures this option.- Parameters:
value- whether the IdP requires signed AuthnRequests- Returns:
- this builder
- Since:
- 1.0.0
-
requireSignedAssertions
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder requireSignedAssertions(@Nullable Boolean value) Configures this option.- Parameters:
value- whether the Assertion must carry its own valid signature- Returns:
- this builder
- Since:
- 1.0.0
-
allowUnsolicitedResponses
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder allowUnsolicitedResponses(@Nullable Boolean value) Enables a separate IdP-initiated login operation for this connection. It is off by default and still requires signature, audience, bearer and replay checks.- Parameters:
value- true to allow unsolicited responses, or null to reset to false- Returns:
- this builder
- Since:
- 1.0.0
-
allowAesCbcEncryption
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder allowAesCbcEncryption(@Nullable Boolean value) Enables decrypting AES-CBC assertions only beneath a verified Response signature. It is off by default and never advertised in SP metadata.- Parameters:
value- true to enable CBC for this IdP, or null to reset to false- Returns:
- this builder
- Since:
- 1.0.0
-
compatibility
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder compatibility(@Nullable Set<@NonNull SamlCompatibilityMode> value) Sets explicit compatibility modes for this one trusted IdP connection. Null clears all modes. SHA-1 stays rejected unless listed here.- Parameters:
value- enabled modes, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
authorizedIdentifierScopes
@CheckReturnValue public @NonNull SamlIdentityProvider.Builder authorizedIdentifierScopes(@Nullable List<@NonNull String> value) Sets exact approved scopes for SAML subject-id and pairwise-id attributes. A scope advertised by metadata is only a starting value; the application approves this list.- Parameters:
value- exact literal scopes, or null to clear- Returns:
- this builder
- Since:
- 1.0.0
-
build
Returns this value.- Returns:
- the immutable IdP connection
- Since:
- 1.0.0
-