• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Extensions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opensaml.saml2.common.Extensions的典型用法代码示例。如果您正苦于以下问题:Java Extensions类的具体用法?Java Extensions怎么用?Java Extensions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Extensions类属于org.opensaml.saml2.common包,在下文中一共展示了Extensions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    RoleDescriptor roleDescriptor = (RoleDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        roleDescriptor.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        roleDescriptor.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof KeyDescriptor) {
        roleDescriptor.getKeyDescriptors().add((KeyDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof Organization) {
        roleDescriptor.setOrganization((Organization) childSAMLObject);
    } else if (childSAMLObject instanceof ContactPerson) {
        roleDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:RoleDescriptorUnmarshaller.java


示例2: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    AffiliationDescriptor descriptor = (AffiliationDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        descriptor.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        descriptor.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof AffiliateMember) {
        descriptor.getMembers().add((AffiliateMember) childSAMLObject);
    } else if (childSAMLObject instanceof KeyDescriptor) {
        descriptor.getKeyDescriptors().add((KeyDescriptor) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AffiliationDescriptorUnmarshaller.java


示例3: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    Organization org = (Organization) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        org.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof OrganizationName) {
        org.getOrganizationNames().add((OrganizationName) childSAMLObject);
    } else if (childSAMLObject instanceof OrganizationDisplayName) {
        org.getDisplayNames().add((OrganizationDisplayName) childSAMLObject);
    } else if (childSAMLObject instanceof OrganizationURL) {
        org.getURLs().add((OrganizationURL) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:OrganizationUnmarshaller.java


示例4: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    ContactPerson person = (ContactPerson) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        person.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Company) {
        person.setCompany((Company) childSAMLObject);
    } else if (childSAMLObject instanceof GivenName) {
        person.setGivenName((GivenName) childSAMLObject);
    } else if (childSAMLObject instanceof SurName) {
        person.setSurName((SurName) childSAMLObject);
    } else if (childSAMLObject instanceof EmailAddress) {
        person.getEmailAddresses().add((EmailAddress) childSAMLObject);
    } else if (childSAMLObject instanceof TelephoneNumber) {
        person.getTelephoneNumbers().add((TelephoneNumber) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:ContactPersonUnmarshaller.java


示例5: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    EntityDescriptor entityDescriptor = (EntityDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        entityDescriptor.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        entityDescriptor.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof RoleDescriptor) {
        entityDescriptor.getRoleDescriptors().add((RoleDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof AffiliationDescriptor) {
        entityDescriptor.setAffiliationDescriptor((AffiliationDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof Organization) {
        entityDescriptor.setOrganization((Organization) childSAMLObject);
    } else if (childSAMLObject instanceof ContactPerson) {
        entityDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
    } else if (childSAMLObject instanceof AdditionalMetadataLocation) {
        entityDescriptor.getAdditionalMetadataLocations().add((AdditionalMetadataLocation) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:EntityDescriptorUnmarshaller.java


示例6: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        entitiesDescriptor.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof EntitiesDescriptor) {
        entitiesDescriptor.getEntitiesDescriptors().add((EntitiesDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof EntityDescriptor) {
        entitiesDescriptor.getEntityDescriptors().add((EntityDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        entitiesDescriptor.setSignature((Signature) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:EntitiesDescriptorUnmarshaller.java


示例7: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    ArtifactResponse artifactResponse = (ArtifactResponse) parentSAMLObject;

    if (childSAMLObject instanceof Issuer) {
        artifactResponse.setIssuer((Issuer) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        artifactResponse.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof Extensions) {
        artifactResponse.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Status) {
        artifactResponse.setStatus((Status) childSAMLObject);
    } else {
        artifactResponse.setMessage((SAMLObject) childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:ArtifactResponseUnmarshaller.java


示例8: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    StatusResponseType sr = (StatusResponseType) parentSAMLObject;

    if (childSAMLObject instanceof Issuer) {
        sr.setIssuer((Issuer) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        sr.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof Extensions) {
        sr.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Status) {
        sr.setStatus((Status) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:StatusResponseTypeUnmarshaller.java


示例9: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    EntityDescriptor entityDescriptor = (EntityDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
        entityDescriptor.setExtensions((Extensions) childSAMLObject); 
    } else if (childSAMLObject instanceof Signature) {
        entityDescriptor.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof RoleDescriptor) {
        entityDescriptor.getRoleDescriptors().add((RoleDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof AffiliationDescriptor) {
        entityDescriptor.setAffiliationDescriptor((AffiliationDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof Organization) {
        entityDescriptor.setOrganization((Organization) childSAMLObject);
    } else if (childSAMLObject instanceof ContactPerson) {
        entityDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
    } else if (childSAMLObject instanceof AdditionalMetadataLocation) {
        entityDescriptor.getAdditionalMetadataLocations().add((AdditionalMetadataLocation) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:24,代码来源:EntityDescriptorUnmarshaller.java


示例10: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, AffiliationDescriptor.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    AffiliationDescriptor descriptor = (AffiliationDescriptor) buildXMLObject(qname);

    descriptor.setOwnerID(expectedOwnerID);
    descriptor.setID(expectedID);
    
    descriptor.setSignature( buildSignatureSkeleton() );

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    descriptor.setExtensions((Extensions) buildXMLObject(extensionsQName));

    QName affilMemberQName = new QName(SAMLConstants.SAML20MD_NS, AffiliateMember.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    descriptor.getMembers().add((AffiliateMember) buildXMLObject(affilMemberQName));
    descriptor.getMembers().add((AffiliateMember) buildXMLObject(affilMemberQName));
    descriptor.getMembers().add((AffiliateMember) buildXMLObject(affilMemberQName));

    assertEquals(expectedChildElementsDOM, descriptor);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:21,代码来源:AffiliationDescriptorTest.java


示例11: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, EntitiesDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) buildXMLObject(qname);
    entitiesDescriptor.setID(expectedID);
    
    entitiesDescriptor.setSignature( buildSignatureSkeleton() );

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    entitiesDescriptor.setExtensions((Extensions) buildXMLObject(extensionsQName));
    
    QName entitiesDescriptorQName = new QName(SAMLConstants.SAML20MD_NS, EntitiesDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    QName entityDescriptorQName = new QName(SAMLConstants.SAML20MD_NS, EntityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    entitiesDescriptor.getEntitiesDescriptors().add((EntitiesDescriptor) buildXMLObject(entitiesDescriptorQName));
    entitiesDescriptor.getEntityDescriptors().add((EntityDescriptor) buildXMLObject(entityDescriptorQName));
    entitiesDescriptor.getEntitiesDescriptors().add((EntitiesDescriptor) buildXMLObject(entitiesDescriptorQName));
    entitiesDescriptor.getEntityDescriptors().add((EntityDescriptor) buildXMLObject(entityDescriptorQName));
    entitiesDescriptor.getEntitiesDescriptors().add((EntitiesDescriptor) buildXMLObject(entitiesDescriptorQName));
    assertEquals(expectedChildElementsDOM, entitiesDescriptor);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:21,代码来源:EntitiesDescriptorTest.java


示例12: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/**
 * 
 */
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, Organization.DEFAULT_ELEMENT_LOCAL_NAME);
    Organization org = (Organization) buildXMLObject(qname);

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    org.setExtensions((Extensions) buildXMLObject(extensionsQName));

    QName nameQName = new QName(SAMLConstants.SAML20MD_NS, OrganizationName.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < 3; i++) {
        org.getOrganizationNames().add((OrganizationName) buildXMLObject(nameQName));
    }

    QName displayNameQName = new QName(SAMLConstants.SAML20MD_NS, OrganizationDisplayName.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < 2; i++) {
        org.getDisplayNames().add((OrganizationDisplayName) buildXMLObject(displayNameQName));
    }

    QName urlQName = new QName(SAMLConstants.SAML20MD_NS, OrganizationURL.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    org.getURLs().add((OrganizationURL) buildXMLObject(urlQName));
    
    assertEquals(expectedChildElementsDOM, org);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:29,代码来源:OrganizationTest.java


示例13: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
        throws UnmarshallingException {
    Extensions extensions = (Extensions) parentXMLObject;

    extensions.getUnknownXMLObjects().add(childXMLObject);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ExtensionsUnmarshaller.java


示例14: processChildElement

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    RequestAbstractType req = (RequestAbstractType) parentSAMLObject;

    if (childSAMLObject instanceof Issuer) {
        req.setIssuer((Issuer) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
        req.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof Extensions) {
        req.setExtensions((Extensions) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:RequestAbstractTypeUnmarshaller.java


示例15: getSAMLExtensions

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
protected Extensions getSAMLExtensions(HttpServletRequest request) {

        try {
            String samlRequest = request.getParameter(SSOConstants.HTTP_POST_PARAM_SAML2_AUTH_REQ);
            if (samlRequest == null) {
                samlRequest = (String) request.getAttribute(SSOConstants.HTTP_POST_PARAM_SAML2_AUTH_REQ);
            }

            if (samlRequest != null) {
                XMLObject xmlObject;
                if (SSOConstants.HTTP_POST.equals(request.getMethod())) {
                    xmlObject = unmarshall(SSOUtils.decodeForPost(samlRequest));
                } else {
                    xmlObject = unmarshall(SSOUtils.decode(samlRequest));
                }
                if (xmlObject instanceof AuthnRequest) {
                    AuthnRequest authnRequest = (AuthnRequest) xmlObject;
                    Extensions oldExtensions = authnRequest.getExtensions();
                    if (oldExtensions != null) {
                        ExtensionsBuilder extBuilder = new ExtensionsBuilder();
                        Extensions extensions = extBuilder.buildObject(SAMLConstants.SAML20P_NS,
                                Extensions.LOCAL_NAME, SAMLConstants.SAML20P_PREFIX);
                        extensions.setDOM(oldExtensions.getDOM());
                        return extensions;
                    }
                }
            }
        } catch (Exception e) { // TODO IDENTITY-2421
            //ignore
            log.debug("Error while loading SAML Extensions", e);
        }

        return null;
    }
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:35,代码来源:DefaultSAML2SSOManager.java


示例16: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */

    public void testChildElementsMarshall() {
        QName qname = new QName(SAMLConstants.SAML20MD_NS, AuthnAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        AuthnAuthorityDescriptor descriptor = (AuthnAuthorityDescriptor) buildXMLObject(qname);

        descriptor.addSupportedProtocol(SAMLConstants.SAML20P_NS);
        
        QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        descriptor.setExtensions((Extensions) buildXMLObject(extensionsQName));
        
        QName orgQName = new QName(SAMLConstants.SAML20MD_NS, Organization.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        descriptor.setOrganization((Organization) buildXMLObject(orgQName));
        
        QName contactPersonQName = new QName(SAMLConstants.SAML20MD_NS, ContactPerson.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        for (int i = 0; i < expectedContactPersons; i++) {
            descriptor.getContactPersons().add((ContactPerson) buildXMLObject(contactPersonQName));
        }
        
        QName authnQueryServiceQName = new QName(SAMLConstants.SAML20MD_NS, AuthnQueryService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        for (int i = 0; i < expectedAuthnQueryServices; i++) {
            descriptor.getAuthnQueryServices().add((AuthnQueryService) buildXMLObject(authnQueryServiceQName));
        }

        QName assertionIDRequestServiceQName = new QName(SAMLConstants.SAML20MD_NS, AssertionIDRequestService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        for (int i = 0; i < expectedAssertionIdRequestServices; i++) {
            descriptor.getAssertionIDRequestServices().add((AssertionIDRequestService) buildXMLObject(assertionIDRequestServiceQName));
        }
        
        QName nameIDFormatQName = new QName(SAMLConstants.SAML20MD_NS, NameIDFormat.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
        for (int i = 0; i < expectedNameIdFormats; i++) {
            descriptor.getNameIDFormats().add((NameIDFormat) buildXMLObject(nameIDFormatQName));
        }
        
        assertEquals(expectedChildElementsDOM, descriptor);
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:37,代码来源:AuthnAuthorityDescriptorTest.java


示例17: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall()
{
    QName qname = new QName(SAMLConstants.SAML20MD_NS, ContactPerson.DEFAULT_ELEMENT_LOCAL_NAME);
    ContactPerson person = (ContactPerson) buildXMLObject(qname);
    
    person.setType(expectedPersonType);

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setExtensions((Extensions) buildXMLObject(extensionsQName));
    
    QName companuQName = new QName(SAMLConstants.SAML20MD_NS, Company.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setCompany((Company) buildXMLObject(companuQName));
    
    QName givenNameQName = new QName(SAMLConstants.SAML20MD_NS, GivenName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setGivenName((GivenName) buildXMLObject(givenNameQName));
    
    QName surnameQName = new QName(SAMLConstants.SAML20MD_NS, SurName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    person.setSurName((SurName) buildXMLObject(surnameQName));
    
    QName teleQName = new QName(SAMLConstants.SAML20MD_NS, TelephoneNumber.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < telephoneNumberCount; i++) {
        person.getTelephoneNumbers().add((TelephoneNumber) buildXMLObject(teleQName));
    }
    
    QName emailQName = new QName(SAMLConstants.SAML20MD_NS, EmailAddress.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < emailAddressCount; i++) {
        person.getEmailAddresses().add((EmailAddress) buildXMLObject(emailQName));
    }
    
    assertEquals(expectedChildElementsDOM, person);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:33,代码来源:ContactPersonTest.java


示例18: testChildElementsMarshall

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, PDPDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    PDPDescriptor descriptor = (PDPDescriptor) buildXMLObject(qname);

    QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    descriptor.setExtensions((Extensions) buildXMLObject(extensionsQName));

    QName authzQName = new QName(SAMLConstants.SAML20MD_NS, AuthzService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < 3; i++) {
        descriptor.getAuthzServices().add((AuthzService) buildXMLObject(authzQName));
    }

    QName assertIDReqQName = new QName(SAMLConstants.SAML20MD_NS, AssertionIDRequestService.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < 2; i++) {
        descriptor.getAssertionIDRequestServices()
                .add((AssertionIDRequestService) buildXMLObject(assertIDReqQName));
    }

    QName nameIDFormatQName = new QName(SAMLConstants.SAML20MD_NS, NameIDFormat.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX);
    descriptor.getNameIDFormats().add((NameIDFormat) buildXMLObject(nameIDFormatQName));

    assertEquals(expectedChildElementsDOM, descriptor);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:28,代码来源:PDPDescriptorTest.java


示例19: webSSOprofile

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
@Bean
public WebSSOProfile webSSOprofile() {
    return new WebSSOProfileImpl() {

        @Override
        protected AuthnRequest getAuthnRequest(SAMLMessageContext context, WebSSOProfileOptions options, AssertionConsumerService assertionConsumer, SingleSignOnService bindingService) throws SAMLException, MetadataProviderException {
            AuthnRequest authnRequest = super.getAuthnRequest(context, options, assertionConsumer, bindingService);
            authnRequest.setExtensions(buildExtensions());
            return authnRequest;
        }

        /**
         * Language extension to AuthnRequest:
         *
         *  <samlp:Extensions>
                <vetuma xmlns="urn:vetuma:SAML:2.0:extensions">
                    <LG>[fi|sv]</LG>
                </vetuma>
            </samlp:Extensions>
         */
        private Extensions buildExtensions() {
            Extensions extensions = new ExtensionsBuilder()
                    .buildObject("urn:oasis:names:tc:SAML:2.0:protocol", "Extensions", "saml2p");
            XSAny vetuma = new XSAnyBuilder().buildObject(new QName("urn:vetuma:SAML:2.0:extensions", "vetuma"));
            XSAny language = new XSAnyBuilder().buildObject(new QName("urn:vetuma:SAML:2.0:extensions", "LG"));

            String idpLanguageFromTarget = TargetStoringFilter.getRequestParamTarget(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest())
                    .map(t -> t.startsWith(Urls.FRONT_SV) ? "sv" : "fi")
                    .orElse("fi");

            language.setTextContent(idpLanguageFromTarget);
            extensions.getUnknownXMLObjects().add(vetuma);
            vetuma.getUnknownXMLObjects().add(language);
            return extensions;
        }
    };
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:38,代码来源:WebSecurityConfig.java


示例20: getExtensions

import org.opensaml.saml2.common.Extensions; //导入依赖的package包/类
/** {@inheritDoc} */
public Extensions getExtensions() {
    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ChainingMetadataProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FieldCacheRangeFilter类代码示例发布时间:2022-05-22
下一篇:
Java EventProvider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap