public class SAMLBearerTokenUtil extends Object
| Constructor and Description |
|---|
SAMLBearerTokenUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createSAMLAssertion(Principal principal,
Set<String> roles,
String issuerName,
String forService)
Creates a SAML Assertion that can be used as a bearer token when invoking REST
services.
|
static String |
createSAMLAssertion(Principal principal,
Set<String> roles,
String issuerName,
String forService,
int timeValidInMillis)
Creates a SAML Assertion that can be used as a bearer token when invoking REST
services.
|
static KeyPair |
getKeyPair(KeyStore keystore,
String keyAlias,
String keyPassword)
Gets the key pair to use to either sign an assertion or validate an assertion's signature.
|
static boolean |
isSAMLAssertionSignatureValid(Document samlAssertion,
KeyPair keyPair)
Validates the SAML assertion's signature is valid.
|
static KeyStore |
loadKeystore(String keystorePath,
String keystorePassword)
Loads the keystore.
|
static String |
signSAMLAssertion(String assertion,
KeyPair keypair)
Signs a SAML assertion using the given security
KeyPair. |
static void |
validateAssertion(org.picketlink.identity.federation.saml.v2.assertion.AssertionType assertion,
javax.servlet.http.HttpServletRequest request,
Set<String> allowedIssuers)
Validates that the assertion is acceptable based on configurable criteria.
|
public static String createSAMLAssertion(Principal principal, Set<String> roles, String issuerName, String forService)
org.overlord.commons.auth.jboss7.SAMLBearerTokenLoginModule.
In Tomcat7 this means protecting the REST services with org.overlord.commons.auth.tomcat7.SAMLBearerTokenAuthenticator.principal - the authenticated principalroles - the authenticated principal's rolesissuerName - the issuer name (typically the context of the calling web app)forService - the web context of the REST service being invokedpublic static String createSAMLAssertion(Principal principal, Set<String> roles, String issuerName, String forService, int timeValidInMillis)
org.overlord.commons.auth.jboss7.SAMLBearerTokenLoginModule.
In Tomcat7 this means protecting the REST services with org.overlord.commons.auth.tomcat7.SAMLBearerTokenAuthenticator.principal - roles - issuerName - forService - timeValidInMillis - public static String signSAMLAssertion(String assertion, KeyPair keypair)
KeyPair.assertion - keypair - public static boolean isSAMLAssertionSignatureValid(Document samlAssertion, KeyPair keyPair)
public static KeyPair getKeyPair(KeyStore keystore, String keyAlias, String keyPassword) throws Exception
Exceptionpublic static KeyStore loadKeystore(String keystorePath, String keystorePassword) throws Exception
keystorePath - keystorePassword - Exceptionpublic static void validateAssertion(org.picketlink.identity.federation.saml.v2.assertion.AssertionType assertion,
javax.servlet.http.HttpServletRequest request,
Set<String> allowedIssuers)
throws LoginException
assertion - request - allowedIssuers - LoginExceptionCopyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.