Class SecretsSaml2CredentialResolver
- java.lang.Object
-
- org.forgerock.openig.handler.saml.SecretsSaml2CredentialResolver
-
- All Implemented Interfaces:
org.forgerock.openam.saml2.plugins.Saml2CredentialResolver
public class SecretsSaml2CredentialResolver extends Object implements org.forgerock.openam.saml2.plugins.Saml2CredentialResolver
An implementation ofSaml2CredentialResolverthat provides support for resolving secrets configured in an IG route/heap. This class is enabled via theorg.forgerock.openam.saml2.credential.resolver.classproperty via an entry in theFederationConfig.propertiesfile or by passing it as a Java VM -D flag set to:org.forgerock.openam.saml2.credential.resolver.class=org.forgerock.openig.handler.saml.SecretsSaml2CredentialResolver
Where the{ "condition": "${find(request.uri.path, '^/sp')}", "handler": { "type": "SamlFederationHandler", "config": { "assertionMapping": { "cn": "cn", "sn": "sn" }, "redirectURI": "/", "secretsProvider": { "type": "KeyStoreSecretStore", "config": { "file": "${openig.baseDirectory.path.concat('/SAML/sp-keystore.jceks')}", "storeType": "jceks", "storePassword": "store.id", "keyEntryPassword": "key.id", "secretsProvider": { "type": "SystemAndEnvSecretStore" }, "mappings": [{ "secretId": "sp.signing.SP", "aliases": ["signing"] }, { "secretId": "sp.decryption.SP", "aliases": ["decryption"] } ] } } } } }"secretId"item used in the keystore mappings is made up of a prefix of the entity's role (always sp for IG) and either.signing.or.decryption.depending on the purpose of the secret. The final part of the"secretId"item is based on theentityIdof the Service Provider, which isIG-SPin the example above.The AM SAML federation library will fallback to using direct keystore look-ups based on entries in the SP extended metadata when no
Saml2CredentialResolverimplementation has been specified.
-
-
Constructor Summary
Constructors Constructor Description SecretsSaml2CredentialResolver()Default constructor to allow for some logging to show when it is created.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.openam.saml2.crypto.signing.Saml2SigningCredentialsresolveActiveSigningCredential(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role)Set<PrivateKey>resolveValidDecryptionCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role)Set<X509Certificate>resolveValidEncryptionCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role)Set<X509Certificate>resolveValidSigningCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role)
-
-
-
Method Detail
-
resolveActiveSigningCredential
public org.forgerock.openam.saml2.crypto.signing.Saml2SigningCredentials resolveActiveSigningCredential(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role) throws com.sun.identity.saml2.common.SAML2Exception
- Specified by:
resolveActiveSigningCredentialin interfaceorg.forgerock.openam.saml2.plugins.Saml2CredentialResolver- Throws:
com.sun.identity.saml2.common.SAML2Exception
-
resolveValidSigningCredentials
public Set<X509Certificate> resolveValidSigningCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role) throws com.sun.identity.saml2.common.SAML2Exception
- Specified by:
resolveValidSigningCredentialsin interfaceorg.forgerock.openam.saml2.plugins.Saml2CredentialResolver- Throws:
com.sun.identity.saml2.common.SAML2Exception
-
resolveValidDecryptionCredentials
public Set<PrivateKey> resolveValidDecryptionCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role) throws com.sun.identity.saml2.common.SAML2Exception
- Specified by:
resolveValidDecryptionCredentialsin interfaceorg.forgerock.openam.saml2.plugins.Saml2CredentialResolver- Throws:
com.sun.identity.saml2.common.SAML2Exception
-
resolveValidEncryptionCredentials
public Set<X509Certificate> resolveValidEncryptionCredentials(String realm, String entityId, org.forgerock.openam.saml2.Saml2EntityRole role) throws com.sun.identity.saml2.common.SAML2Exception
- Specified by:
resolveValidEncryptionCredentialsin interfaceorg.forgerock.openam.saml2.plugins.Saml2CredentialResolver- Throws:
com.sun.identity.saml2.common.SAML2Exception
-
-