本文整理汇总了Java中uk.gov.ida.saml.core.extensions.IdaAuthnContext类的典型用法代码示例。如果您正苦于以下问题:Java IdaAuthnContext类的具体用法?Java IdaAuthnContext怎么用?Java IdaAuthnContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdaAuthnContext类属于uk.gov.ida.saml.core.extensions包,在下文中一共展示了IdaAuthnContext类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: aDefaultAssertion
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
private AssertionBuilder aDefaultAssertion() {
return
anAssertion()
.withSubject(aSubject()
.withNameId(aNameId().withValue("some-pid").build())
.build())
.withConditions(aConditions()
.withoutDefaultAudienceRestriction()
.addAudienceRestriction(anAudienceRestriction()
.withAudienceId(VERIFY_SERVICE_PROVIDER_ENTITY_ID)
.build())
.build())
.addAuthnStatement(anAuthnStatement()
.withAuthnContext(anAuthnContext()
.withAuthnContextClassRef(anAuthnContextClassRef()
.withAuthnContextClasRefValue(IdaAuthnContext.LEVEL_2_AUTHN_CTX)
.build())
.build())
.build());
}
示例2: shouldProduceUserAccountCreationJson
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldProduceUserAccountCreationJson() throws Exception {
AttributeQuery attributeQuery = AttributeQueryBuilder.anAttributeQuery()
.withId(REQUEST_ID)
.withAttributes(asList())
.withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
.withSubject(aSubjectWithAssertions(asList(
anAuthnStatementAssertion(IdaAuthnContext.LEVEL_1_AUTHN_CTX, REQUEST_ID),
aMatchingDatasetAssertion(asList(), false, REQUEST_ID)
), REQUEST_ID, HUB_ENTITY_ID, PID))
.build();
makeAttributeQueryRequest(UNKNOWN_USER_URI, attributeQuery, signatureAlgorithmForHub, digestAlgorithmForHub, HUB_ENTITY_ID);
List<LoggedRequest> requests = findAll(RequestPatternBuilder.allRequests());
assertThat(requests.size()).isEqualTo(1);
Path filePath = Paths.get("verify-matching-service-test-tool/src/main/resources/user-account-creation.json");
Map requestSent = objectMapper.readValue(requests.get(0).getBodyAsString(), Map.class);
Map requestExpected = objectMapper.readValue(readExpectedJson(filePath), Map.class);
assertThat(requestSent).isEqualToComparingFieldByFieldRecursively(requestExpected);
}
示例3: aFraudResponseFromIdpBuilder
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
public ResponseBuilder aFraudResponseFromIdpBuilder(String idpEntityId, String persistentId) throws Exception {
TestCredentialFactory idpSigningCredentialFactory =
new TestCredentialFactory(publicSigningCerts.get(idpEntityId), privateSigningKeys.get(idpEntityId));
String requestId = generateId();
final Subject mdsAssertionSubject = SubjectBuilder.aSubject()
.withPersistentId(persistentId)
.withSubjectConfirmation(SubjectConfirmationBuilder.aSubjectConfirmation()
.withSubjectConfirmationData(SubjectConfirmationDataBuilder.aSubjectConfirmationData()
.withInResponseTo(requestId)
.build())
.build())
.build();
final Subject authnAssertionSubject = SubjectBuilder.aSubject()
.withNameId(buildNameID(persistentId))
.withSubjectConfirmation(SubjectConfirmationBuilder.aSubjectConfirmation()
.withSubjectConfirmationData(SubjectConfirmationDataBuilder.aSubjectConfirmationData()
.withInResponseTo(requestId)
.build())
.build())
.build();
final AttributeStatement matchingDatasetAttributeStatement = MatchingDatasetAttributeStatementBuilder_1_1.aMatchingDatasetAttributeStatement_1_1().build();
final Credential encryptingCredential = hubEncryptionCredentialFactory.getEncryptingCredential();
final Credential signingCredential = idpSigningCredentialFactory.getSigningCredential();
final AssertionBuilder mdsAssertion = AssertionBuilder.anAssertion().withId(generateId())
.withIssuer(IssuerBuilder.anIssuer().withIssuerId(idpEntityId).build())
.withSubject(mdsAssertionSubject)
.addAttributeStatement(matchingDatasetAttributeStatement);
final AssertionBuilder authnAssertion = AssertionBuilder.anAssertion().withId(generateId())
.addAttributeStatement(anAttributeStatement()
.addAttribute(IdpFraudEventIdAttributeBuilder.anIdpFraudEventIdAttribute().withValue("a-fraud-event").build())
.addAttribute(Gpg45StatusAttributeBuilder.aGpg45StatusAttribute().withValue("IT01").build())
.addAttribute(anIPAddress().build())
.build())
.withIssuer(IssuerBuilder.anIssuer().withIssuerId(idpEntityId).build())
.withSubject(authnAssertionSubject)
.addAuthnStatement(AuthnStatementBuilder.anAuthnStatement()
.withAuthnContext(AuthnContextBuilder.anAuthnContext()
.withAuthnContextClassRef(AuthnContextClassRefBuilder.anAuthnContextClassRef()
.withAuthnContextClasRefValue(IdaAuthnContext.LEVEL_X_AUTHN_CTX)
.build())
.build())
.build());
ResponseBuilder responseBuilder = ResponseBuilder.aResponse().withId(generateId())
.withIssuer(IssuerBuilder.anIssuer().withIssuerId(idpEntityId).build())
.withInResponseTo(requestId)
.addEncryptedAssertion(mdsAssertion
.withSignature(SignatureBuilder.aSignature().withSigningCredential(signingCredential).build())
.buildWithEncrypterCredential(encryptingCredential))
.addEncryptedAssertion(authnAssertion
.withSignature(SignatureBuilder.aSignature().withSigningCredential(signingCredential).build())
.buildWithEncrypterCredential(encryptingCredential));
return responseBuilder;
}
示例4: anAuthnStatementAssertion
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
public static Assertion anAuthnStatementAssertion() {
return anAuthnStatementAssertion(IdaAuthnContext.LEVEL_2_AUTHN_CTX, "default-request-id");
}
示例5: shouldProduceLoA2SimpleCase
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldProduceLoA2SimpleCase() throws Exception {
AttributeQuery attributeQuery = AttributeQueryBuilder.anAttributeQuery()
.withId(REQUEST_ID)
.withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
.withSubject(aSubjectWithAssertions(asList(
anAuthnStatementAssertion(IdaAuthnContext.LEVEL_2_AUTHN_CTX, REQUEST_ID),
aMatchingDatasetAssertion(asList(
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Joe")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsFirstname(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Bob Rob")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsMiddlename(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Dou")
.withVerified(true)
.withFrom(new DateTime(2010, 1, 20, 0, 0, DateTimeZone.UTC))
.withTo(null)
.build())
.buildAsSurname(),
aGender_1_1().withValue("Male").withVerified(true).withFrom(null).withTo(null).build(),
aDate_1_1().addValue(
aDateValue()
.withValue("1980-05-24")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build()).buildAsDateOfBirth(),
anAddressAttribute().addAddress(
anAddressAttributeValue()
.addLines(asList("10 George Street"))
.withFrom(new DateTime(2005, 5, 14, 0, 0, DateTimeZone.UTC))
.withInternationalPostcode("GB1 2PF")
.withPostcode("GB1 2PF")
.withUprn("833F1187-9F33-A7E27B3F211E")
.withVerified(true)
.withTo(null)
.build())
.buildCurrentAddress()
), false, REQUEST_ID)), REQUEST_ID, HUB_ENTITY_ID, PID))
.build();
Path path = Paths.get("verify-matching-service-test-tool/src/main/resources/LoA2-simple-case.json");
assertThatRequestThatWillBeSentIsEquivalentToFile(attributeQuery, path);
}
示例6: shouldProduceLoA2SimpleExcludingOptionalAddressFieldsCase
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldProduceLoA2SimpleExcludingOptionalAddressFieldsCase() throws Exception {
AttributeQuery attributeQuery = AttributeQueryBuilder.anAttributeQuery()
.withId(REQUEST_ID)
.withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
.withSubject(aSubjectWithAssertions(asList(
anAuthnStatementAssertion(IdaAuthnContext.LEVEL_2_AUTHN_CTX, REQUEST_ID),
aMatchingDatasetAssertion(asList(
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Joe")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsFirstname(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Bob Rob")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsMiddlename(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Dou")
.withVerified(true)
.withFrom(new DateTime(2010, 01, 20, 0, 0, DateTimeZone.UTC))
.withTo(null)
.build())
.buildAsSurname(),
aGender_1_1().withValue("Male").withVerified(true).withFrom(null).withTo(null).build(),
aDate_1_1().addValue(
aDateValue()
.withValue("1980-05-24")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build()).buildAsDateOfBirth(),
anAddressAttribute().addAddress(
anAddressAttributeValue()
.withFrom(new DateTime(2005, 5, 14, 0, 0, DateTimeZone.UTC))
.withInternationalPostcode(null)
.withPostcode(null)
.withUprn(null)
.withVerified(true)
.withTo(null)
.build())
.buildCurrentAddress()
), false, REQUEST_ID)), REQUEST_ID, HUB_ENTITY_ID, PID))
.build();
Path path = Paths.get("verify-matching-service-test-tool/src/main/resources/simple-case-excluding-optional-address-fields.json");
assertThatRequestThatWillBeSentIsEquivalentToFile(attributeQuery, path);
}
示例7: shouldProduceLoA1SimpleCase
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldProduceLoA1SimpleCase() throws Exception {
AttributeQuery attributeQuery = AttributeQueryBuilder.anAttributeQuery()
.withId(REQUEST_ID)
.withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
.withSubject(aSubjectWithAssertions(asList(
anAuthnStatementAssertion(IdaAuthnContext.LEVEL_1_AUTHN_CTX, REQUEST_ID),
aMatchingDatasetAssertion(asList(
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Joe")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsFirstname(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Bob Rob")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build())
.buildAsMiddlename(),
aPersonName_1_1().addValue(
aPersonNameValue()
.withValue("Dou")
.withVerified(true)
.withFrom(new DateTime(2015, 5, 14, 0, 0, DateTimeZone.UTC))
.withTo(null)
.build())
.buildAsSurname(),
aGender_1_1().withValue("Male").withVerified(true).withFrom(null).withTo(null).build(),
aDate_1_1().addValue(
aDateValue()
.withValue("1980-05-24")
.withVerified(true)
.withFrom(null)
.withTo(null)
.build()).buildAsDateOfBirth(),
anAddressAttribute().addAddress(
anAddressAttributeValue()
.addLines(asList("10 George Street"))
.withFrom(new DateTime(2005, 5, 14, 0, 0, DateTimeZone.UTC))
.withInternationalPostcode("GB1 2PF")
.withPostcode("GB1 2PF")
.withUprn("833F1187-9F33-A7E27B3F211E")
.withVerified(true)
.withTo(null)
.build())
.buildCurrentAddress()
), false, REQUEST_ID)), REQUEST_ID, HUB_ENTITY_ID, PID))
.build();
Path path = Paths.get("verify-matching-service-test-tool/src/main/resources/LoA1-simple-case.json");
assertThatRequestThatWillBeSentIsEquivalentToFile(attributeQuery, path);
}
示例8: shouldTransformAuthnStatementWithLevel1
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldTransformAuthnStatementWithLevel1() throws Exception {
verifyLevel(AuthnContext.LEVEL_1, IdaAuthnContext.LEVEL_1_AUTHN_CTX);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAuthnStatementToAuthnStatementTransformerTest.java
示例9: shouldTransformAuthnStatementWithLevel2
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldTransformAuthnStatementWithLevel2() throws Exception {
verifyLevel(AuthnContext.LEVEL_2, IdaAuthnContext.LEVEL_2_AUTHN_CTX);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAuthnStatementToAuthnStatementTransformerTest.java
示例10: shouldTransformAuthnStatementWithLevel3
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldTransformAuthnStatementWithLevel3() throws Exception {
verifyLevel(AuthnContext.LEVEL_3, IdaAuthnContext.LEVEL_3_AUTHN_CTX);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAuthnStatementToAuthnStatementTransformerTest.java
示例11: shouldTransformAuthnStatementWithLevel4
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldTransformAuthnStatementWithLevel4() throws Exception {
verifyLevel(AuthnContext.LEVEL_4, IdaAuthnContext.LEVEL_4_AUTHN_CTX);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAuthnStatementToAuthnStatementTransformerTest.java
示例12: shouldTransformAuthnStatementWithLevelX
import uk.gov.ida.saml.core.extensions.IdaAuthnContext; //导入依赖的package包/类
@Test
public void shouldTransformAuthnStatementWithLevelX() throws Exception {
verifyLevel(AuthnContext.LEVEL_X, IdaAuthnContext.LEVEL_X_AUTHN_CTX);
}
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAuthnStatementToAuthnStatementTransformerTest.java