Java Code Examples for org.opensaml.core.xml.schema.XSString
The following examples show how to use
org.opensaml.core.xml.schema.XSString. These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: centraldogma Source File: SamlAuthSsoHandler.java License: Apache License 2.0 | 6 votes |
@Nullable private String findLoginNameFromAttributes(Response response) { if (Strings.isNullOrEmpty(attributeLoginName)) { return null; } return response.getAssertions() .stream() .flatMap(s -> s.getAttributeStatements().stream()) .flatMap(s -> s.getAttributes().stream()) .filter(attr -> attr.getName().equals(attributeLoginName)) .findFirst() .map(attr -> { final XMLObject v = attr.getAttributeValues().get(0); if (v instanceof XSString) { return ((XSString) v).getValue(); } else { return null; } }) .orElse(null); }
Example 2
Source Project: springboot-shiro-cas-mybatis Source File: SimpleMetadataUIInfo.java License: MIT License | 5 votes |
/** * Gets string values from the list of mdui objects. * * @param items the items * @return the string values */ private Collection<String> getStringValues(final List<?> items) { final List<String> list = new ArrayList<>(); for (final Object d : items) { if (d instanceof XSURI) { list.add(((XSURI) d).getValue()); } else if (d instanceof XSString) { list.add(((XSString) d).getValue()); } } return list; }
Example 3
Source Project: springboot-shiro-cas-mybatis Source File: AbstractSamlObjectBuilder.java License: MIT License | 5 votes |
/** * New attribute value. * * @param value the value * @param elementName the element name * @return the xS string */ protected final XSString newAttributeValue(final Object value, final QName elementName) { final XSStringBuilder attrValueBuilder = new XSStringBuilder(); final XSString stringValue = attrValueBuilder.buildObject(elementName, XSString.TYPE_NAME); if (value instanceof String) { stringValue.setValue((String) value); } else { stringValue.setValue(value.toString()); } return stringValue; }
Example 4
Source Project: OpenSAML-ref-project-demo-v3 Source File: ConsumerServlet.java License: Apache License 2.0 | 5 votes |
private void logAssertionAttributes(Assertion assertion) { for (Attribute attribute : assertion.getAttributeStatements().get(0).getAttributes()) { logger.info("Attribute name: " + attribute.getName()); for (XMLObject attributeValue : attribute.getAttributeValues()) { logger.info("Attribute value: " + ((XSString) attributeValue).getValue()); } } }
Example 5
Source Project: carbon-apimgt Source File: TokenMgtUtil.java License: Apache License 2.0 | 5 votes |
private static String getAttributeValue(XMLObject attributeValue) { if (attributeValue == null){ return null; } else if (attributeValue instanceof XSString){ return getStringAttributeValue((XSString) attributeValue); } else if(attributeValue instanceof XSAnyImpl){ return getAnyAttributeValue((XSAnyImpl) attributeValue); } else { return attributeValue.toString(); } }
Example 6
Source Project: carbon-apimgt Source File: SAMLGroupIDExtractorImpl.java License: Apache License 2.0 | 5 votes |
/** * Get the String value from XMLObject * * @param attributeValue XMLObject of attribute value recived in SAML Assertion * * @return attribute value as a String */ private String getAttributeValue(XMLObject attributeValue) { if (attributeValue == null){ return null; } else if (attributeValue instanceof XSString){ return getStringAttributeValue((XSString) attributeValue); } else if(attributeValue instanceof XSAnyImpl){ return getAnyAttributeValue((XSAnyImpl) attributeValue); } else { return attributeValue.toString(); } }
Example 7
Source Project: carbon-apimgt Source File: APIKeyMgtUtil.java License: Apache License 2.0 | 5 votes |
private static String getAttributeValue(XMLObject attributeValue) { if (attributeValue == null){ return null; } else if (attributeValue instanceof XSString){ return getStringAttributeValue((XSString) attributeValue); } else if(attributeValue instanceof XSAnyImpl){ return getAnyAttributeValue((XSAnyImpl) attributeValue); } else { return attributeValue.toString(); } }
Example 8
Source Project: sling-whiteboard Source File: Saml2User.java License: Apache License 2.0 | 4 votes |
public void addUserProperty(String key, XMLObject attributeValue) { this.userProperties.put(key, ((XSString) attributeValue).getValue()); }
Example 9
Source Project: carbon-apimgt Source File: TokenMgtUtil.java License: Apache License 2.0 | 4 votes |
private static String getStringAttributeValue(XSString attributeValue) { return attributeValue.getValue(); }
Example 10
Source Project: carbon-apimgt Source File: APIKeyMgtUtil.java License: Apache License 2.0 | 4 votes |
private static String getStringAttributeValue(XSString attributeValue) { return attributeValue.getValue(); }
Example 11
Source Project: carbon-apimgt Source File: SAMLGroupIDExtractorImpl.java License: Apache License 2.0 | 2 votes |
/** * Get the String value from XSString object * * @param attributeValue XSString Object instance of attribute value received in SAML Assertion * @return attribute value as a String */ private String getStringAttributeValue(XSString attributeValue) { return attributeValue.getValue(); }