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


Java Assertion.setIssuer方法代码示例

本文整理汇总了Java中org.opensaml.saml.saml2.core.Assertion.setIssuer方法的典型用法代码示例。如果您正苦于以下问题:Java Assertion.setIssuer方法的具体用法?Java Assertion.setIssuer怎么用?Java Assertion.setIssuer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opensaml.saml.saml2.core.Assertion的用法示例。


在下文中一共展示了Assertion.setIssuer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newAssertion

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
/**
 * Create a new SAML1 response object.
 *
 * @param authnStatement the authn statement
 * @param issuer the issuer
 * @param issuedAt the issued at
 * @param id the id
 * @return the assertion
 */
public Assertion newAssertion(final AuthnStatement authnStatement, final String issuer,
                              final DateTime issuedAt, final String id) {
    final Assertion assertion = newSamlObject(Assertion.class);
    assertion.setID(id);
    assertion.setIssueInstant(issuedAt);
    assertion.setIssuer(newIssuer(issuer));
    assertion.getAuthnStatements().add(authnStatement);
    return assertion;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:AbstractSaml20ObjectBuilder.java

示例2: newAssertion

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
/**
 * Create a new SAML1 response object.
 *
 * @param authnStatement the authn statement
 * @param issuer         the issuer
 * @param issuedAt       the issued at
 * @param id             the id
 * @return the assertion
 */
public Assertion newAssertion(final List<Statement> authnStatement, final String issuer,
                              final ZonedDateTime issuedAt, final String id) {
    final Assertion assertion = newSamlObject(Assertion.class);
    assertion.setID(id);
    assertion.setIssueInstant(DateTimeUtils.dateTimeOf(issuedAt));
    assertion.setIssuer(newIssuer(issuer));
    assertion.getStatements().addAll(authnStatement);
    return assertion;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:19,代码来源:AbstractSaml20ObjectBuilder.java

示例3: apply

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
public Assertion apply(MatchingServiceAssertion originalAssertion) {

        Assertion transformedAssertion = openSamlXmlObjectFactory.createAssertion();
        transformedAssertion.setIssueInstant(originalAssertion.getIssueInstant());

        Issuer transformedIssuer = openSamlXmlObjectFactory.createIssuer(originalAssertion.getIssuerId());
        transformedAssertion.setIssuer(transformedIssuer);
        transformedAssertion.setID(originalAssertion.getId());

        Subject subject = outboundAssertionToSubjectTransformer.transform(originalAssertion);
        transformedAssertion.setSubject(subject);

        MatchingServiceAuthnStatement authnStatement = originalAssertion.getAuthnStatement();

        transformedAssertion.getAuthnStatements().add(matchingServiceAuthnStatementToAuthnStatementTransformer.transform(authnStatement));

        Conditions conditions = openSamlXmlObjectFactory.createConditions();
        AudienceRestriction audienceRestriction = openSamlXmlObjectFactory.createAudienceRestriction(originalAssertion.getAudience());
        conditions.getAudienceRestrictions().add(audienceRestriction);
        transformedAssertion.setConditions(conditions);

        List<Attribute> userAttributesForAccountCreation = originalAssertion.getUserAttributesForAccountCreation();
        if (!userAttributesForAccountCreation.isEmpty()) {
            addAttributes(transformedAssertion, userAttributesForAccountCreation);
        }


        return transformedAssertion;
    }
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:30,代码来源:MatchingServiceAssertionToAssertionTransformer.java

示例4: aCycle3DatasetAssertion

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
@Test
public void decorate_shouldCallTheAssertionValidatorExpectingItselfAsTheRecipientWhenTheAssertionIsNotTheMatchingDatasetAssertion() throws Exception {
    Assertion cycle3Assertion = aCycle3DatasetAssertion("foo", "bar");
    cycle3Assertion.setIssuer(anIssuer().withIssuerId(TestEntityIds.HUB_ENTITY_ID).build());
    cycle3Assertion.setSubject(aSubject()
            .withSubjectConfirmation(
                    aSubjectConfirmation()
                            .withSubjectConfirmationData(
                                    aSubjectConfirmationData()
                                            .withRecipient(issuerId)
                                            .build())
                            .build())
            .build());
    AttributeQuery query = anAttributeQuery()
            .withIssuer(anIssuer().withIssuerId(TestEntityIds.HUB_ENTITY_ID).build())
            .withId("blah")
            .withSubject(aSubject()
                    .withSubjectConfirmation(aSubjectConfirmation()
                            .withSubjectConfirmationData(aSubjectConfirmationData()
                                    .withRecipient(issuerId)
                                    .build())
                            .build())
                    .build())
            .build();

    when(configuration.getEntityId()).thenReturn("an-entity-id");
    validator.validateHubAssertions(new ValidatedAttributeQuery(query), singletonList(cycle3Assertion));

    verify(assertionValidator).validate(any(Assertion.class), anyString(), anyString());
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:31,代码来源:SamlAttributeQueryAssertionsValidatorTest.java

示例5: givenASetOfValidatedIdpAssertions

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
private ValidatedAssertions givenASetOfValidatedIdpAssertions() {
    Assertion matchingDatasetAssertion = openSamlXmlObjectFactory.createAssertion();
    Assertion authnStatementAssertion = openSamlXmlObjectFactory.createAssertion();
    Issuer mdsIssuer = openSamlXmlObjectFactory.createIssuer(IDP_ENTITY_ID);
    Issuer authnStatementIssuer = openSamlXmlObjectFactory.createIssuer(IDP_ENTITY_ID);
    matchingDatasetAssertion.setIssuer(mdsIssuer);
    authnStatementAssertion.setIssuer(authnStatementIssuer);
    return new ValidatedAssertions(ImmutableList.of(matchingDatasetAssertion, authnStatementAssertion));
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:10,代码来源:InboundMatchingServiceRequestUnmarshallerTest.java

示例6: givenASetOfValidatedHubAssertions

import org.opensaml.saml.saml2.core.Assertion; //导入方法依赖的package包/类
private ValidatedAssertions givenASetOfValidatedHubAssertions() {
    Assertion cycle3DataAssertion = openSamlXmlObjectFactory.createAssertion();
    Issuer hubIssuer = openSamlXmlObjectFactory.createIssuer(TestEntityIds.HUB_ENTITY_ID);
    cycle3DataAssertion.setIssuer(hubIssuer);
    return new ValidatedAssertions(ImmutableList.of(cycle3DataAssertion));
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:7,代码来源:InboundMatchingServiceRequestUnmarshallerTest.java


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