@BeforeClass public static void initVM() throws Exception { Security.addProvider(new BouncyCastleProvider()); DefaultBootstrap.bootstrap(); }
@BeforeAll public static void initializeOpenSAML() throws Exception { if (!org.apache.xml.security.Init.isInitialized()) { DefaultBootstrap.bootstrap(); } }
@BeforeClass public static void bootstrap() throws Exception { Security.addProvider(new BouncyCastleProvider()); DefaultBootstrap.bootstrap(); NamedKeyInfoGeneratorManager keyInfoGeneratorManager = Configuration.getGlobalSecurityConfiguration().getKeyInfoGeneratorManager(); keyInfoGeneratorManager.getManager(SAML_METADATA_KEY_INFO_GENERATOR); }
@BeforeClass public static void bootstrap() throws Exception { Security.addProvider(new BouncyCastleProvider()); DefaultBootstrap.bootstrap(); NamedKeyInfoGeneratorManager keyInfoGeneratorManager = Configuration.getGlobalSecurityConfiguration().getKeyInfoGeneratorManager(); keyInfoGeneratorManager.getManager(SAMLConstants.SAML_METADATA_KEY_INFO_GENERATOR); }
@Before public void setup() { try { DefaultBootstrap.bootstrap(); } catch (ConfigurationException e) { } tokenServices = mock(AuthorizationServerTokenServices.class);
@Test public void testDoGetMetadata() throws Exception { String metadataString = new Scanner(new File("../uaa/src/main/resources/idp.xml")).useDelimiter("\\Z").next(); ConfigMetadataProvider provider = new ConfigMetadataProvider(IdentityZone.getUaa().getId(), "testalias", metadataString); ConfigMetadataProvider provider2 = new ConfigMetadataProvider(IdentityZone.getUaa().getId(), "testalias", metadataString); DefaultBootstrap.bootstrap(); provider.setParserPool(new BasicParserPool()); XMLObject xmlObject = provider.doGetMetadata(); assertNotNull(xmlObject); assertEquals("http://openam.example.com:8181/openam", ((EntityDescriptorImpl) xmlObject).getEntityID()); assertEquals(provider, provider2); } }
public Response processSAMLResponse(String responseMessage) { Response responseObject = null; try { DefaultBootstrap.bootstrap(); responseObject = SAMLUtils.decodeSAMLResponse(responseMessage); } catch (ConfigurationException | FactoryConfigurationError | ParserConfigurationException | SAXException | IOException | UnmarshallingException e) { s_logger.error("SAMLResponse processing error: " + e.getMessage()); } return responseObject; }
public void initialize() throws ConfigurationException { IdentityZone.getUaa().getConfig().getSamlConfig().setPrivateKey(PROVIDER_PRIVATE_KEY); IdentityZone.getUaa().getConfig().getSamlConfig().setPrivateKeyPassword(PROVIDER_PRIVATE_KEY_PASSWORD); IdentityZone.getUaa().getConfig().getSamlConfig().setCertificate(PROVIDER_CERTIFICATE); AddBcProvider.noop(); DefaultBootstrap.bootstrap(); initializeSimple(); }
public OpenSAMLContext(Properties properties, Provisioner provisioner) { // Bootstrap openSAML try { DefaultBootstrap.bootstrap(); } catch (ConfigurationException e) { throw new RuntimeException(e); } replayCacheDuration = Long.parseLong(properties.getProperty("replayCacheDuration", "14400000")); maxParserPoolSize = Integer.parseInt(properties.getProperty("maxParserPoolSize", "2")); entityId = properties.getProperty("entityId", "no-property-named-entityId"); clockSkew = Integer.parseInt(properties.getProperty("clockSkew", "90")); newExpires = Integer.parseInt(properties.getProperty("newExpires", "300")); assertionConsumerURI = properties.getProperty("assertionConsumerURI", DEFAULT_ASSERTION_CONSUMER_URI); idpEntityId = properties.getProperty("idpEntityId", "no-property-named-idpEntityId"); idpCertificate = properties.getProperty("idpCertificate", "no-property-named-idpCertificate"); idpUrl = properties.getProperty("idpUrl", "no-property-named-idpUrl"); spPrivateKey = properties.getProperty("spPrivateKey", "no-property-named-spPrivateKey"); spCertificate = properties.getProperty("spCertificate", "no-property-named-spCertificate"); this.provisioner = provisioner; samlMessageHandler = new SAMLMessageHandlerImpl(samlMessageDecoder(), securityPolicyResolver()); samlMessageHandler.setEntityId(entityId); samlMessageHandler.setVelocityEngine(velocityEngine()); samlMessageHandler.setNeedsSigning(true); validatorSuite = new SAML2ValidatorSuite(); }
public static String buildAuthnRequestUrl(final String authnId, final SAMLProviderMetadata spMetadata, final SAMLProviderMetadata idpMetadata, final String signatureAlgorithm) { String redirectUrl = ""; try { DefaultBootstrap.bootstrap(); AuthnRequest authnRequest = SAMLUtils.buildAuthnRequestObject(authnId, spMetadata.getEntityId(), idpMetadata.getSsoUrl(), spMetadata.getSsoUrl()); PrivateKey privateKey = null; if (spMetadata.getKeyPair() != null) { privateKey = spMetadata.getKeyPair().getPrivate(); } redirectUrl = idpMetadata.getSsoUrl() + "?" + SAMLUtils.generateSAMLRequestSignature("SAMLRequest=" + SAMLUtils.encodeSAMLRequest(authnRequest), privateKey, signatureAlgorithm); } catch (ConfigurationException | FactoryConfigurationError | MarshallingException | IOException | NoSuchAlgorithmException | InvalidKeyException | java.security.SignatureException e) { s_logger.error("SAML AuthnRequest message building error: " + e.getMessage()); } return redirectUrl; }
DefaultBootstrap.bootstrap(); if (idpMetaDataUrl.startsWith("http")) { _idpMetaDataProvider = new HTTPMetadataProvider(_timer, client, idpMetaDataUrl);
DefaultBootstrap.bootstrap(); } catch (ConfigurationException | FactoryConfigurationError e) { s_logger.error("OpenSAML Bootstrapping error: " + e.getMessage());
public static void doBootstrap() { if (!isBootStrapped) { try { DefaultBootstrap.bootstrap(); isBootStrapped = true; } catch (ConfigurationException e) { log.error("Error in bootstrapping the OpenSAML2 library", e); } } }
/** * Bootstrap the OpenSAML2 library only if it is not bootstrapped. */ public static void doBootstrap() { if (!isBootStrapped) { try { DefaultBootstrap.bootstrap(); isBootStrapped = true; } catch (ConfigurationException e) { log.error("Error in bootstrapping the OpenSAML2 library", e); } } }
private void doBootstrap() { try { DefaultBootstrap.bootstrap(); } catch (ConfigurationException e) { logger.error("Error in bootstrapping the OpenSAML2 library.", e); } } }
DefaultBootstrap.bootstrap(); } catch (ConfigurationException | FactoryConfigurationError e) { s_logger.error("OpenSAML Bootstrapping error: " + e.getMessage());
public static void doBootstrap() throws SSOAgentException { if (!isBootStrapped) { try { DefaultBootstrap.bootstrap(); isBootStrapped = true; } catch (ConfigurationException e) { throw new SSOAgentException("Error in bootstrapping the OpenSAML2 library", e); } } }
public static void initialize() throws SAMLException { if (doneInit) { return; } try { DefaultBootstrap.bootstrap(); doneInit = true; } catch (ConfigurationException e) { throw new SAMLException(e); } } }
public static void doBootstrap() throws SSOAgentException { if (!isBootStrapped) { try { DefaultBootstrap.bootstrap(); isBootStrapped = true; } catch (ConfigurationException e) { throw new SSOAgentException("Error in bootstrapping the OpenSAML2 library", e); } } }
private synchronized static void ensureOpenSamlIsInitialized() throws SamlException { if (!initializedOpenSaml) { try { DefaultBootstrap.bootstrap(); initializedOpenSaml = true; } catch (Throwable ex) { throw new SamlException("Error while initializing the Open SAML library", ex); } } }