public SamlCredential(final String assertion) { if (StringUtil.isNullOrEmpty(assertion)) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "assertion"); this.assertion = assertion; }
public SamlCredential(final String assertion) { if (StringUtil.isNullOrEmpty(assertion)) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "assertion"); this.assertion = assertion; }
public SamlCredential(final String assertion) { if (StringUtil.isNullOrEmpty(assertion)) throw logger.nullArgumentError("assertion"); this.assertion = assertion; }
this.requestType = properties.getProperty(REQUEST_TYPE); if (!StringUtil.isNullOrEmpty(properties.getProperty(SOAP_BINDING))) { this.soapBinding = properties.getProperty(SOAP_BINDING);
public void writeAttributeTypeWithoutRootTag(SAML11AttributeType attributeType) throws ProcessingException { String attributeName = attributeType.getAttributeName(); if (StringUtil.isNullOrEmpty(attributeName)) throw new ProcessingException(ErrorCodes.WRITER_NULL_VALUE + "attribute name"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAME, attributeName); String attributeNamespace = attributeType.getAttributeNamespace().toString(); if (StringUtil.isNullOrEmpty(attributeNamespace)) throw new ProcessingException(ErrorCodes.WRITER_NULL_VALUE + "attribute namespace"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAMESPACE, attributeNamespace); List<Object> attributeValues = attributeType.get(); if (attributeValues != null) { for (Object attributeValue : attributeValues) { if (attributeValue instanceof String) { writeStringAttributeValue((String) attributeValue); } else throw new RuntimeException(ErrorCodes.WRITER_UNSUPPORTED_ATTRIB_VALUE + attributeValue.getClass().getName()); } } }
public void writeAttributeTypeWithoutRootTag(SAML11AttributeType attributeType) throws ProcessingException { String attributeName = attributeType.getAttributeName(); if (StringUtil.isNullOrEmpty(attributeName)) throw new ProcessingException(ErrorCodes.WRITER_NULL_VALUE + "attribute name"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAME, attributeName); String attributeNamespace = attributeType.getAttributeNamespace().toString(); if (StringUtil.isNullOrEmpty(attributeNamespace)) throw new ProcessingException(ErrorCodes.WRITER_NULL_VALUE + "attribute namespace"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAMESPACE, attributeNamespace); List<Object> attributeValues = attributeType.get(); if (attributeValues != null) { for (Object attributeValue : attributeValues) { if (attributeValue instanceof String) { writeStringAttributeValue((String) attributeValue); } else throw new RuntimeException(ErrorCodes.WRITER_UNSUPPORTED_ATTRIB_VALUE + attributeValue.getClass().getName()); } } }
public void writeAttributeTypeWithoutRootTag(SAML11AttributeType attributeType) throws ProcessingException { String attributeName = attributeType.getAttributeName(); if (StringUtil.isNullOrEmpty(attributeName)) throw logger.writerNullValueError("attribute name"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAME, attributeName); String attributeNamespace = attributeType.getAttributeNamespace().toString(); if (StringUtil.isNullOrEmpty(attributeNamespace)) throw logger.writerNullValueError("attribute namespace"); StaxUtil.writeAttribute(writer, SAML11Constants.ATTRIBUTE_NAMESPACE, attributeNamespace); List<Object> attributeValues = attributeType.get(); if (attributeValues != null) { for (Object attributeValue : attributeValues) { if (attributeValue instanceof String) { writeStringAttributeValue((String) attributeValue); } else throw logger.writerUnsupportedAttributeValueError(attributeValue.getClass().getName()); } } }
if (StringUtil.isNullOrEmpty(salt)) throw new RuntimeException(ErrorCodes.OPTION_NOT_SET + "Salt"); if (StringUtil.isNullOrEmpty(iCount)) throw new RuntimeException(ErrorCodes.OPTION_NOT_SET + "Iteration Count");
if (StringUtil.isNullOrEmpty(salt)) throw new RuntimeException(ErrorCodes.OPTION_NOT_SET + "Salt"); if (StringUtil.isNullOrEmpty(iCount)) throw new RuntimeException(ErrorCodes.OPTION_NOT_SET + "Iteration Count");
/** * Get the IDP Type * @param idpSSODescriptor * @return */ public static IDPType getIDPType(IDPSSODescriptorType idpSSODescriptor) { IDPType idp = new IDPType(); List<EndpointType> endpoints = idpSSODescriptor.getSingleSignOnService(); if (endpoints != null) { for (EndpointType endpoint : endpoints) { if (endpoint.getBinding().toString().equals(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())) { idp.setIdentityURL(endpoint.getLocation().toString()); break; } } } if (StringUtil.isNullOrEmpty(idp.getIdentityURL())) { throw new IllegalStateException(ErrorCodes.NULL_VALUE + "identity url"); } return idp; } }
if (StringUtil.isNullOrEmpty(salt)) throw logger.optionNotSet("Salt"); if (StringUtil.isNullOrEmpty(iCount)) throw logger.optionNotSet("Iteration Count");
/** * Get the IDP Type * @param idpSSODescriptor * @return */ public static IDPType getIDPType(IDPSSODescriptorType idpSSODescriptor) { IDPType idp = new IDPType(); List<EndpointType> endpoints = idpSSODescriptor.getSingleSignOnService(); if (endpoints != null) { for (EndpointType endpoint : endpoints) { if (endpoint.getBinding().toString().equals(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())) { idp.setIdentityURL(endpoint.getLocation().toString()); break; } } } if (StringUtil.isNullOrEmpty(idp.getIdentityURL())) { throw new IllegalStateException(ErrorCodes.NULL_VALUE + "identity url"); } return idp; } }
/** * <p> * Returns the PublicKey to be used to verify signatures for SAML tokens issued by the IDP. * </p> * * @return * @throws org.picketlink.identity.federation.core.interfaces.TrustKeyConfigurationException * @throws org.picketlink.identity.federation.core.interfaces.TrustKeyProcessingException */ protected PublicKey getIDPPublicKey() throws TrustKeyConfigurationException, TrustKeyProcessingException { if (this.keyManager == null) { throw logger.trustKeyManagerMissing(); } String idpValidatingAlias = (String) this.keyManager.getAdditionalOption(ServiceProviderBaseProcessor.IDP_KEY); if (StringUtil.isNullOrEmpty(idpValidatingAlias)) { idpValidatingAlias = safeURL(spConfiguration.getIdentityURL()).getHost(); } return keyManager.getValidatingKey(idpValidatingAlias); }
if(StringUtil.isNullOrEmpty(assertionStr)) throw new RuntimeException(ErrorCodes.NULL_VALUE + "Assertion String is null or empty");
/** * Get the IDP Type * * @param idpSSODescriptor * @return */ public static IDPType getIDPType(IDPSSODescriptorType idpSSODescriptor) { IDPType idp = new IDPType(); List<EndpointType> endpoints = idpSSODescriptor.getSingleSignOnService(); if (endpoints != null) { for (EndpointType endpoint : endpoints) { if (endpoint.getBinding().toString().equals(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())) { idp.setIdentityURL(endpoint.getLocation().toString()); break; } } } if (StringUtil.isNullOrEmpty(idp.getIdentityURL())) { throw logger.nullValueError("identity url"); } return idp; }
public void write(UsernameTokenType usernameToken) throws ProcessingException { StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME_TOKEN, WSSE_NS); StaxUtil.writeNameSpace(writer, WSSE_PREFIX, WSSE_NS); String id = usernameToken.getId(); if (StringUtil.isNullOrEmpty(id)) throw logger.nullValueError("Id on the UsernameToken"); QName wsuIDQName = new QName(WSU_NS, ID, WSU_PREFIX); StaxUtil.writeNameSpace(writer, WSU_PREFIX, WSU_NS); StaxUtil.writeAttribute(writer, wsuIDQName, id); AttributedString userNameAttr = usernameToken.getUsername(); if (userNameAttr == null) throw logger.nullValueError("User Name is null on the UsernameToken"); StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME, WSSE_NS); StaxUtil.writeCharacters(writer, userNameAttr.getValue()); StaxUtil.writeEndElement(writer); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public void write(UsernameTokenType usernameToken) throws ProcessingException { StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME_TOKEN, WSSE_NS); StaxUtil.writeNameSpace(writer, WSSE_PREFIX, WSSE_NS); String id = usernameToken.getId(); if (StringUtil.isNullOrEmpty(id)) throw new ProcessingException(ErrorCodes.NULL_VALUE + "Id on the UsernameToken"); QName wsuIDQName = new QName(WSU_NS, ID, WSU_PREFIX); StaxUtil.writeNameSpace(writer, WSU_PREFIX, WSU_NS); StaxUtil.writeAttribute(writer, wsuIDQName, id); AttributedString userNameAttr = usernameToken.getUsername(); if (userNameAttr == null) throw new ProcessingException(ErrorCodes.NULL_VALUE + "User Name is null on the UsernameToken"); StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME, WSSE_NS); StaxUtil.writeCharacters(writer, userNameAttr.getValue()); StaxUtil.writeEndElement(writer); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
public void write(UsernameTokenType usernameToken) throws ProcessingException { StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME_TOKEN, WSSE_NS); StaxUtil.writeNameSpace(writer, WSSE_PREFIX, WSSE_NS); String id = usernameToken.getId(); if (StringUtil.isNullOrEmpty(id)) throw new ProcessingException(ErrorCodes.NULL_VALUE + "Id on the UsernameToken"); QName wsuIDQName = new QName(WSU_NS, ID, WSU_PREFIX); StaxUtil.writeNameSpace(writer, WSU_PREFIX, WSU_NS); StaxUtil.writeAttribute(writer, wsuIDQName, id); AttributedString userNameAttr = usernameToken.getUsername(); if (userNameAttr == null) throw new ProcessingException(ErrorCodes.NULL_VALUE + "User Name is null on the UsernameToken"); StaxUtil.writeStartElement(writer, WSSE_PREFIX, USERNAME, WSSE_NS); StaxUtil.writeCharacters(writer, userNameAttr.getValue()); StaxUtil.writeEndElement(writer); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
if (StringUtil.isNullOrEmpty(assertionConsumerURL))
if (StringUtil.isNullOrEmpty(assertionConsumerURL))