本文整理汇总了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());
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例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()));
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例15: getBindingURI
import org.opensaml.common.xml.SAMLConstants; //导入依赖的package包/类
/** {@inheritDoc} */
public String getBindingURI() {
return SAMLConstants.SAML1_ARTIFACT_BINDING_URI;
}