當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。