当前位置: 首页>>代码示例>>Java>>正文


Java IdaAuthnContext类代码示例

本文整理汇总了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());
}
 
开发者ID:alphagov,项目名称:verify-service-provider,代码行数:21,代码来源:ResponseServiceTest.java

示例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);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:25,代码来源:TestToolExamplesSchemaTests.java

示例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;
    }
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:57,代码来源:AuthnResponseFactory.java

示例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");
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:4,代码来源:AssertionHelper.java

示例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);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:59,代码来源:TestToolExamplesSchemaTests.java

示例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);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:58,代码来源:TestToolExamplesSchemaTests.java

示例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);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:59,代码来源:TestToolExamplesSchemaTests.java

示例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


注:本文中的uk.gov.ida.saml.core.extensions.IdaAuthnContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。