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


Java SAMLConstants类代码示例

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


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

示例1: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    Logo logo = (Logo) samlObject;

    if (logo.getXMLLang() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(logo.getXMLLang());
        domElement.setAttributeNodeNS(attribute);
    }
    if (logo.getHeight() != null) {
        domElement.setAttributeNS(null, Logo.HEIGHT_ATTR_NAME, logo.getHeight().toString());
    }
    if (logo.getWidth() != null) {
        domElement.setAttributeNS(null, Logo.WIDTH_ATTR_NAME, logo.getWidth().toString());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:LogoMarshaller.java

示例2: getAcsEndpoint

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * Gets the source location used to for the artifacts created by this encoder.
 * 
 * @param requestContext current request context
 * 
 * @return source location used to for the artifacts created by this encoder
 */
protected Endpoint getAcsEndpoint(SAMLMessageContext<SAMLObject, SAMLObject, NameID> requestContext) {
    BasicEndpointSelector selector = new BasicEndpointSelector();
    selector.setEndpointType(ArtifactResolutionService.DEFAULT_ELEMENT_NAME);
    selector.getSupportedIssuerBindings().add(SAMLConstants.SAML2_SOAP11_BINDING_URI);
    selector.setMetadataProvider(requestContext.getMetadataProvider());
    selector.setEntityMetadata(requestContext.getLocalEntityMetadata());
    selector.setEntityRoleMetadata(requestContext.getLocalEntityRoleMetadata());

    Endpoint acsEndpoint = selector.selectEndpoint();

    if (acsEndpoint == null) {
        log.error("No artifact resolution service endpoint defined for the entity "
                + requestContext.getOutboundMessageIssuer());
        return null;
    }

    return acsEndpoint;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:SAML2ArtifactType0004Builder.java

示例3: populateRelyingPartyMetadata

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * Populates the peer's entity metadata if a metadata provide is present in the message context. Populates the
 * peer's role descriptor if the entity metadata was available and the role name is present in the message context.
 * 
 * @param messageContext current message context
 * 
 * @throws MessageDecodingException thrown if there is a problem populating the message context
 */
protected void populateRelyingPartyMetadata(SAMLMessageContext messageContext) throws MessageDecodingException {
    MetadataProvider metadataProvider = messageContext.getMetadataProvider();
    try {
        if (metadataProvider != null) {
            EntityDescriptor relyingPartyMD = metadataProvider.getEntityDescriptor(messageContext
                    .getInboundMessageIssuer());
            messageContext.setPeerEntityMetadata(relyingPartyMD);

            QName relyingPartyRole = messageContext.getPeerEntityRole();
            if (relyingPartyMD != null && relyingPartyRole != null) {
                List<RoleDescriptor> roles = relyingPartyMD.getRoleDescriptors(relyingPartyRole,
                        SAMLConstants.SAML11P_NS);
                if (roles != null && roles.size() > 0) {
                    messageContext.setPeerEntityRoleMetadata(roles.get(0));
                }
            }
        }
    } catch (MetadataProviderException e) {
        log.error("Error retrieving metadata for relying party " + messageContext.getInboundMessageIssuer(), e);
        throw new MessageDecodingException("Error retrieving metadata for relying party "
                + messageContext.getInboundMessageIssuer(), e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:BaseSAML2MessageDecoder.java

示例4: getOneTimeUse

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/** {@inheritDoc} */
public OneTimeUse getOneTimeUse() {
    QName conditionQName = new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20_PREFIX);
    List<OneTimeUse> list = (List<OneTimeUse>) conditions.subList(conditionQName);
    if (list == null || list.size() == 0) {
        return null;
    } else {
        return list.get(0);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:ConditionsImpl.java

示例5: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    OrganizationURL url = (OrganizationURL) samlObject;

    if (url.getURL() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                OrganizationURL.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(url.getURL().getLanguage());
        domElement.setAttributeNodeNS(attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:OrganizationURLMarshaller.java

示例6: processChildElement

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

    Attribute attribute = (Attribute) parentSAMLObject;

    QName childQName = childSAMLObject.getElementQName();
    if (childQName.getLocalPart().equals("AttributeValue")
            && childQName.getNamespaceURI().equals(SAMLConstants.SAML1_NS)) {
        attribute.getAttributeValues().add(childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:AttributeUnmarshaller.java

示例7: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    LocalizedURI name = (LocalizedURI) samlObject;

    if (name.getURI() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(name.getURI().getLanguage());
        domElement.setAttributeNodeNS(attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LocalizedURIMarshaller.java

示例8: processAttribute

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
    if (attribute.getLocalName().equals(LangBearing.XML_LANG_ATTR_LOCAL_NAME)
            && SAMLConstants.XML_NS.equals(attribute.getNamespaceURI())) {
        Keywords keywords = (Keywords) samlObject;

        keywords.setXMLLang(attribute.getValue());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:KeywordsUnmarshaller.java

示例9: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    Keywords words = (Keywords) samlObject;

    if (words.getXMLLang() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(words.getXMLLang());
        domElement.setAttributeNodeNS(attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:KeywordsMarshaller.java

示例10: processAttribute

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**  {@inheritDoc} */
protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
    Logo logo = (Logo) samlObject;

    if (attribute.getLocalName().equals(LangBearing.XML_LANG_ATTR_LOCAL_NAME)
            && SAMLConstants.XML_NS.equals(attribute.getNamespaceURI())) {
        logo.setXMLLang(attribute.getValue());
    } else if (attribute.getLocalName().equals(Logo.HEIGHT_ATTR_NAME)) {
        logo.setHeight(Integer.valueOf(attribute.getValue()));
    } else if (attribute.getLocalName().equals(Logo.WIDTH_ATTR_NAME)) {
        logo.setWidth(Integer.valueOf(attribute.getValue()));
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LogoUnmarshaller.java

示例11: getProxyRestriction

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/** {@inheritDoc} */
public ProxyRestriction getProxyRestriction() {
    QName conditionQName = new QName(SAMLConstants.SAML20_NS, ProxyRestriction.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20_PREFIX);
    List<ProxyRestriction> list = (List<ProxyRestriction>) conditions.subList(conditionQName);
    if (list == null || list.size() == 0) {
        return null;
    } else {
        return list.get(0);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:ConditionsImpl.java

示例12: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    ServiceName name = (ServiceName) samlObject;

    if (name.getName() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                ServiceName.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(name.getName().getLanguage());
        domElement.setAttributeNodeNS(attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:ServiceNameMarshaller.java

示例13: marshallAttributes

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    OrganizationName name = (OrganizationName) samlObject;

    if (name.getName() != null) {
        Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
                OrganizationName.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX);
        attribute.setValue(name.getName().getLanguage());
        domElement.setAttributeNodeNS(attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:OrganizationNameMarshaller.java

示例14: buildObject

import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/** {@inheritDoc} */
public ArtifactResponse buildObject() {
    return buildObject(SAMLConstants.SAML20P_NS, ArtifactResponse.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20P_PREFIX);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ArtifactResponseBuilder.java

示例15: getBindingURI

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


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