本文整理汇总了Java中uk.gov.ida.saml.core.IdaSamlBootstrap类的典型用法代码示例。如果您正苦于以下问题:Java IdaSamlBootstrap类的具体用法?Java IdaSamlBootstrap怎么用?Java IdaSamlBootstrap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdaSamlBootstrap类属于uk.gov.ida.saml.core包,在下文中一共展示了IdaSamlBootstrap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VerifyServiceProviderAppRule
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
public VerifyServiceProviderAppRule(MockMsaServer msaServer, String secondaryEncryptionKey, String serviceEntityIdOverride) {
super(
VerifyServiceProviderApplication.class,
"verify-service-provider.yml",
ConfigOverride.config("serviceEntityIds", serviceEntityIdOverride),
ConfigOverride.config("server.connector.port", String.valueOf(0)),
ConfigOverride.config("logging.loggers.uk\\.gov", "DEBUG"),
ConfigOverride.config("samlSigningKey", TEST_RP_PRIVATE_SIGNING_KEY),
ConfigOverride.config("verifyHubConfiguration.environment", "COMPLIANCE_TOOL"),
ConfigOverride.config("samlPrimaryEncryptionKey", TEST_RP_PRIVATE_ENCRYPTION_KEY),
ConfigOverride.config("samlSecondaryEncryptionKey", secondaryEncryptionKey),
ConfigOverride.config("msaMetadata.uri", () -> {
IdaSamlBootstrap.bootstrap();
msaServer.serveDefaultMetadata();
return msaServer.getUri();
}),
ConfigOverride.config("msaMetadata.expectedEntityId", MockMsaServer.MSA_ENTITY_ID)
);
}
示例2: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
KeyStoreResource verifyHubKeystoreResource = aKeyStoreResource()
.withCertificate("VERIFY-FEDERATION", aCertificate().withCertificate(METADATA_SIGNING_A_PUBLIC_CERT).build().getCertificate())
.build();
verifyHubKeystoreResource.create();
applicationTestSupport = new DropwizardTestSupport<>(
VerifyServiceProviderApplication.class,
"verify-service-provider.yml",
config("verifyHubConfiguration.environment", "COMPLIANCE_TOOL"),
config("verifyHubConfiguration.metadata.uri", () -> String.format("http://localhost:%s/SAML2/metadata", wireMockServer.port())),
config("msaMetadata.uri", msaServer::getUri),
config("msaMetadata.expectedEntityId", MockMsaServer.MSA_ENTITY_ID),
config("verifyHubConfiguration.metadata.expectedEntityId", HUB_ENTITY_ID),
config("verifyHubConfiguration.metadata.trustStore.path", verifyHubKeystoreResource.getAbsolutePath()),
config("verifyHubConfiguration.metadata.trustStore.password", verifyHubKeystoreResource.getPassword()),
config("serviceEntityIds", "[\"http://some-service-entity-id\"]"),
config("samlSigningKey", TEST_RP_PRIVATE_SIGNING_KEY),
config("samlPrimaryEncryptionKey", TEST_RP_PRIVATE_ENCRYPTION_KEY)
);
IdaSamlBootstrap.bootstrap();
wireMockServer.start();
msaServer.serveDefaultMetadata();
}
示例3: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
instantValidator = mock(InstantValidator.class);
subjectValidator = mock(SubjectValidator.class);
conditionsValidator = mock(ConditionsValidator.class);
assertion = mock(Assertion.class);
AuthnStatement authnStatement = mock(AuthnStatement.class);
validator = new AssertionValidator(
instantValidator,
subjectValidator,
conditionsValidator
);
when(assertion.getAuthnStatements()).thenReturn(ImmutableList.of(authnStatement));
IdaSamlBootstrap.bootstrap();
}
示例4: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
IdaSamlBootstrap.bootstrap();
reset(manifestReader);
final BasicCredential basicCredential = createBasicCredential();
encrypter = new uk.gov.ida.saml.security.EncrypterFactory().createEncrypter(basicCredential);
decrypter = new DecrypterFactory().createDecrypter(ImmutableList.of(basicCredential));
when(encrypterFactory.createEncrypter()).thenReturn(encrypter);
factory = new AuthnRequestFactory(
DESTINATION,
new PrivateKeyStoreFactory().create(TestEntityIds.TEST_RP).getSigningPrivateKey(),
manifestReader,
encrypterFactory
);
}
示例5: run
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Override
public final void run(MatchingServiceAdapterConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().setDateFormat(new ISO8601DateFormat());
environment.jersey().register(LocalMetadataResource.class);
environment.jersey().register(MatchingServiceResource.class);
environment.jersey().register(UnknownUserAttributeQueryResource.class);
environment.jersey().register(SamlOverSoapExceptionMapper.class);
environment.jersey().register(ExceptionExceptionMapper.class);
MatchingServiceAdapterHealthCheck healthCheck = new MatchingServiceAdapterHealthCheck();
environment.healthChecks().register(healthCheck.getName(), healthCheck);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:17,代码来源:MatchingServiceAdapterApplication.java
示例6: beforeClass
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
IdaSamlBootstrap.bootstrap();
JerseyClientConfiguration jerseyClientConfiguration = JerseyClientConfigurationBuilder.aJerseyClientConfiguration().withTimeout(Duration.seconds(10)).build();
client = new JerseyClientBuilder(policy.getEnvironment())
.using(jerseyClientConfiguration)
.build(EidasSessionResourceContractTest.class.getSimpleName());
sessionId = SessionId.createNewSessionId();
samlAuthnResponseContainerDto = createAuthnResponseSignedByKeyPair(sessionId, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_CERT, TestCertificateStrings.STUB_IDP_PUBLIC_PRIMARY_PRIVATE_KEY);
encryptedIdentityAssertion = AssertionBuilder.anAssertion().withId(UUID.randomUUID().toString()).build();
encryptedIdentityAssertionString = XML_OBJECT_XML_OBJECT_TO_BASE_64_ENCODED_STRING_TRANSFORMER.apply(encryptedIdentityAssertion);
}
示例7: run
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Override
public final void run(SamlEngineConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().registerModule(new GuavaModule());
environment.getObjectMapper().setDateFormat(new ISO8601DateFormat());
// register resources
registerResources(environment, configuration);
// register exception mappers
environment.jersey().register(SamlEngineExceptionMapper.class);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
示例8: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() throws ResolverException, MarshallingException, SignatureException {
IdaSamlBootstrap.bootstrap();
CriteriaSet criteria = new CriteriaSet(new EntityIdCriterion(idpEntityId));
EntityDescriptor idpEntityDescriptor = anEntityDescriptor().withIdpSsoDescriptor(anIdpSsoDescriptor().withSingleSignOnService(anEndpoint().withLocation(idpSSOUri.toASCIIString()).buildSingleSignOnService()).build()).build();
when(metadataProvider.resolveSingle(eq(criteria))).thenReturn(idpEntityDescriptor);
when(metadataProvider.resolveSingle(not(eq(criteria)))).thenReturn(null);
idpSingleSignOnServiceHelper = new IdpSingleSignOnServiceHelper(metadataProvider);
}
示例9: setup
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setup() throws Exception {
IdaSamlBootstrap.bootstrap();
service = new CountryAuthnResponseTranslatorService(
stringToOpenSamlResponseTransformer,
responseFromCountryValidator,
new IdpIdaStatusUnmarshaller(new IdpIdaStatus.IdpIdaStatusFactory(), new SamlStatusToIdpIdaStatusMappingsFactory()),
responseAssertionsFromCountryValidator,
validateSamlResponseIssuedByIdpDestination,
assertionDecrypter,
assertionBlobEncrypter,
samlResponseSignatureValidator,
samlAssertionsSignatureValidator,
new PassthroughAssertionUnmarshaller(new XmlObjectToBase64EncodedStringTransformer<>(), new AuthnContextFactory()));
Response eidasSAMLResponse = (Response) buildResponseFromFile();
ValidatedResponse validateEIDASSAMLResponse = new ValidatedResponse(eidasSAMLResponse);
List<Assertion> decryptedAssertions = eidasSAMLResponse.getAssertions();
when(samlAuthnResponseTranslatorDto.getSamlResponse()).thenReturn("eidas");
when(samlAuthnResponseTranslatorDto.getMatchingServiceEntityId()).thenReturn("mid");
when(stringToOpenSamlResponseTransformer.apply("eidas")).thenReturn(eidasSAMLResponse);
doNothing().when(responseFromCountryValidator).validate(eidasSAMLResponse);
when(samlResponseSignatureValidator.validate(eidasSAMLResponse, IDPSSODescriptor.DEFAULT_ELEMENT_NAME)).thenReturn(validateEIDASSAMLResponse);
when(assertionDecrypter.decryptAssertions(validateEIDASSAMLResponse)).thenReturn(decryptedAssertions);
when(assertionBlobEncrypter.encryptAssertionBlob(eq("mid"), any(String.class))).thenReturn(identityUnderlyingAssertionBlob);
when(samlAssertionsSignatureValidator.validate(decryptedAssertions, IDPSSODescriptor.DEFAULT_ELEMENT_NAME)).thenReturn(new ValidatedAssertions(decryptedAssertions));
}
示例10: run
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Override
public void run(SamlSoapProxyConfiguration configuration, Environment environment) throws Exception {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().setDateFormat(new ISO8601DateFormat());
registerResources(environment);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
示例11: initialize
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<VerifyServiceProviderConfiguration> bootstrap) {
// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor(false)
)
);
IdaSamlBootstrap.bootstrap();
bootstrap.getObjectMapper().setDateFormat(ISO8601DateFormat.getInstance());
}
示例12: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
KeyStoreResource verifyHubKeystoreResource = aKeyStoreResource()
.withCertificate("VERIFY-FEDERATION", aCertificate().withCertificate(METADATA_SIGNING_A_PUBLIC_CERT).build().getCertificate())
.build();
verifyHubKeystoreResource.create();
this.applicationTestSupport = new DropwizardTestSupport<>(
VerifyServiceProviderApplication.class,
"verify-service-provider.yml",
config("verifyHubConfiguration.metadata.uri", () -> String.format("http://localhost:%s/SAML2/metadata", hubServer.port())),
config("msaMetadata.uri", () -> String.format("http://localhost:%s/matching-service/metadata", wireMockServer.port())),
config("verifyHubConfiguration.metadata.expectedEntityId", HUB_ENTITY_ID),
config("msaMetadata.expectedEntityId", MockMsaServer.MSA_ENTITY_ID),
config("verifyHubConfiguration.metadata.trustStore.path", verifyHubKeystoreResource.getAbsolutePath()),
config("verifyHubConfiguration.metadata.trustStore.password", verifyHubKeystoreResource.getPassword())
);
environmentHelper.setEnv(new HashMap<String, String>() {{
put("VERIFY_ENVIRONMENT", "COMPLIANCE_TOOL");
put("MSA_METADATA_URL", "some-msa-metadata-url");
put("MSA_ENTITY_ID", "some-msa-entity-id");
put("SERVICE_ENTITY_IDS", "[\"http://some-service-entity-id\"]");
put("SAML_SIGNING_KEY", TEST_RP_PRIVATE_SIGNING_KEY);
put("SAML_PRIMARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
}});
IdaSamlBootstrap.bootstrap();
wireMockServer.start();
hubServer.serveDefaultMetadata();
}
示例13: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
timeRestrictionValidator = mock(TimeRestrictionValidator.class);
audienceRestrictionValidator = mock(AudienceRestrictionValidator.class);
conditions = mock(Conditions.class);
validator = new ConditionsValidator(timeRestrictionValidator, audienceRestrictionValidator);
IdaSamlBootstrap.bootstrap();
}
示例14: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@Before
public void setUp() {
IdaSamlBootstrap.bootstrap();
}
示例15: setUp
import uk.gov.ida.saml.core.IdaSamlBootstrap; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
IdaSamlBootstrap.bootstrap();
}