Picketlink SVN: r930 - trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-05-10 19:50:51 -0400 (Tue, 10 May 2011)
New Revision: 930
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
Log:
use the JBAS way of getting servlet request as backup
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-05-05 09:22:20 UTC (rev 929)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/BinaryTokenHandler.java 2011-05-10 23:50:51 UTC (rev 930)
@@ -25,6 +25,8 @@
import java.util.List;
import java.util.StringTokenizer;
+import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
@@ -276,7 +278,19 @@
*/
private HttpServletRequest getHttpRequest(MessageContext msgContext)
{
- return (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
+ HttpServletRequest request = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
+ if( request == null)
+ {
+ try
+ {
+ request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
+ }
+ catch (PolicyContextException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return request;
}
/**
13 years, 7 months
Picketlink SVN: r929 - federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/newmodel/saml/v2/assertion.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-05 05:22:20 -0400 (Thu, 05 May 2011)
New Revision: 929
Modified:
federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/newmodel/saml/v2/assertion/AttributeStatementType.java
Log:
Missing serializable
Modified: federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/newmodel/saml/v2/assertion/AttributeStatementType.java
===================================================================
--- federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/newmodel/saml/v2/assertion/AttributeStatementType.java 2011-05-04 07:45:26 UTC (rev 928)
+++ federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/newmodel/saml/v2/assertion/AttributeStatementType.java 2011-05-05 09:22:20 UTC (rev 929)
@@ -22,6 +22,7 @@
package org.picketlink.identity.federation.newmodel.saml.v2.assertion;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -81,8 +82,9 @@
return Collections.unmodifiableList( this.attributes );
}
- public static class ASTChoiceType
+ public static class ASTChoiceType implements Serializable
{
+ private static final long serialVersionUID = 1L;
private AttributeType attribute;
private EncryptedElementType encryptedAssertion;
13 years, 8 months
Picketlink SVN: r928 - in picketlink-seam/trunk/seam-sp/src/main: resources and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-04 03:45:26 -0400 (Wed, 04 May 2011)
New Revision: 928
Modified:
picketlink-seam/trunk/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
picketlink-seam/trunk/seam-sp/src/main/resources/saml-entities.xml
Log:
PLFED-183 seam-sp does not work with ssocircle as IDP
- Enabled commented away code needed for the app to allow SAML SSO
Modified: picketlink-seam/trunk/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
===================================================================
--- picketlink-seam/trunk/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2011-05-04 03:59:09 UTC (rev 927)
+++ picketlink-seam/trunk/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2011-05-04 07:45:26 UTC (rev 928)
@@ -25,7 +25,7 @@
import java.util.List;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.security.Identity;
+import org.jboss.seam.security.Identity;
import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
/**
@@ -44,28 +44,20 @@
{
return false;
}
- else
+ for (AttributeType attribute : samlPrincipal.getAttributes())
{
- throw new RuntimeException();/*
- for (AttributeType attribute : samlPrincipal.getAttributes())
+ if (attribute.getName().equals("role"))
{
- if (attribute.getName().equals("role"))
+ List<Object> value = attribute.getAttributeValue();
+ if (value != null && value.size() > 0)
{
- List<Object> value = attribute.getAttributeValue();
- if (value != null && value.size() > 0)
- {
- roles.add((String) value.get(0));
- }
+ roles.add((String) value.get(0));
}
- }*/
-
- //return true;
+ }
}
- }
- else
- {
return true;
}
+ return true;
}
public String localLogout()
Modified: picketlink-seam/trunk/seam-sp/src/main/resources/saml-entities.xml
===================================================================
--- picketlink-seam/trunk/seam-sp/src/main/resources/saml-entities.xml 2011-05-04 03:59:09 UTC (rev 927)
+++ picketlink-seam/trunk/seam-sp/src/main/resources/saml-entities.xml 2011-05-04 07:45:26 UTC (rev 928)
@@ -9,18 +9,18 @@
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>
-MIICQDCCAakCBEeNB0swDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh
-bGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMQwwCgYDVQQKEwNTdW4xEDAOBgNVBAsTB09w
-ZW5TU08xDTALBgNVBAMTBHRlc3QwHhcNMDgwMTE1MTkxOTM5WhcNMTgwMTEyMTkxOTM5WjBnMQsw
-CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExDDAK
-BgNVBAoTA1N1bjEQMA4GA1UECxMHT3BlblNTTzENMAsGA1UEAxMEdGVzdDCBnzANBgkqhkiG9w0B
-AQEFAAOBjQAwgYkCgYEArSQc/U75GB2AtKhbGS5piiLkmJzqEsp64rDxbMJ+xDrye0EN/q1U5Of+
-RkDsaN/igkAvV1cuXEgTL6RlafFPcUX7QxDhZBhsYF9pbwtMzi4A4su9hnxIhURebGEmxKW9qJNY
-Js0Vo5+IgjxuEWnjnnVgHTs1+mq5QYTA7E6ZyL8CAwEAATANBgkqhkiG9w0BAQQFAAOBgQB3Pw/U
-QzPKTPTYi9upbFXlrAKMwtFf2OW4yvGWWvlcwcNSZJmTJ8ARvVYOMEVNbsT4OFcfu2/PeYoAdiDA
-cGy/F2Zuj8XJJpuQRSE6PtQqBuDEHjjmOQJ0rV/r8mO1ZCtHRhpZ5zYRjhRC9eCbjx9VrFax0JDC
-/FfwWigmrW0Y0Q==
- </ds:X509Certificate>
+ MIICQDCCAakCBEeNB0swDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh
+ bGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMQwwCgYDVQQKEwNTdW4xEDAOBgNVBAsTB09w
+ ZW5TU08xDTALBgNVBAMTBHRlc3QwHhcNMDgwMTE1MTkxOTM5WhcNMTgwMTEyMTkxOTM5WjBnMQsw
+ CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExDDAK
+ BgNVBAoTA1N1bjEQMA4GA1UECxMHT3BlblNTTzENMAsGA1UEAxMEdGVzdDCBnzANBgkqhkiG9w0B
+ AQEFAAOBjQAwgYkCgYEArSQc/U75GB2AtKhbGS5piiLkmJzqEsp64rDxbMJ+xDrye0EN/q1U5Of+
+ RkDsaN/igkAvV1cuXEgTL6RlafFPcUX7QxDhZBhsYF9pbwtMzi4A4su9hnxIhURebGEmxKW9qJNY
+ Js0Vo5+IgjxuEWnjnnVgHTs1+mq5QYTA7E6ZyL8CAwEAATANBgkqhkiG9w0BAQQFAAOBgQB3Pw/U
+ QzPKTPTYi9upbFXlrAKMwtFf2OW4yvGWWvlcwcNSZJmTJ8ARvVYOMEVNbsT4OFcfu2/PeYoAdiDA
+ cGy/F2Zuj8XJJpuQRSE6PtQqBuDEHjjmOQJ0rV/r8mO1ZCtHRhpZ5zYRjhRC9eCbjx9VrFax0JDC
+ /FfwWigmrW0Y0Q==
+ </ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</KeyDescriptor>
13 years, 8 months
Picketlink SVN: r927 - trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-05-03 23:59:09 -0400 (Tue, 03 May 2011)
New Revision: 927
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/SecurityActions.java
Log:
add method
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/SecurityActions.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/SecurityActions.java 2011-05-04 02:56:58 UTC (rev 926)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/SecurityActions.java 2011-05-04 03:59:09 UTC (rev 927)
@@ -117,6 +117,23 @@
});
}
+ /**
+ * Set the system property
+ * @param key
+ * @param value
+ */
+ static void setSystemProperty( final String key, final String value)
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ System.setProperty(key, value);
+ return null;
+ }
+ });
+ }
+
static ClassLoader getClassLoader( final Class<?> clazz)
{
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
13 years, 8 months
Picketlink SVN: r926 - in federation/trunk/picketlink-fed-core/src: test/java/org/picketlink/test/identity/federation/core/parser and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-05-03 22:56:58 -0400 (Tue, 03 May 2011)
New Revision: 926
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java
Log:
fix stringutil sys prop
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2011-05-04 02:15:33 UTC (rev 925)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2011-05-04 02:56:58 UTC (rev 926)
@@ -104,6 +104,7 @@
{
int index = subString.indexOf("::");
defaultValue = subString.substring(index + 2);
+ subString = subString.substring(0, index);
}
sysPropertyValue = SecurityActions.getSystemProperty(subString, defaultValue);
if (sysPropertyValue.isEmpty())
Modified: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java 2011-05-04 02:15:33 UTC (rev 925)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/SystemPropertyAsStringUnitTestCase.java 2011-05-04 02:56:58 UTC (rev 926)
@@ -62,6 +62,8 @@
assertEquals("test", StringUtil.getSystemPropertyAsString("test"));
assertEquals("test/test", StringUtil.getSystemPropertyAsString("test/test"));
+ assertEquals("anil", StringUtil.getSystemPropertyAsString("${test::something}"));
+
assertEquals("anil", StringUtil.getSystemPropertyAsString("${test}"));
assertEquals("test/anil", StringUtil.getSystemPropertyAsString("test/${test}"));
13 years, 8 months
Picketlink SVN: r925 - federation/trunk/picketlink-webapps/sales-post/src/main/webapp/WEB-INF.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-05-03 22:15:33 -0400 (Tue, 03 May 2011)
New Revision: 925
Modified:
federation/trunk/picketlink-webapps/sales-post/src/main/webapp/WEB-INF/picketlink-idfed.xml
Log:
use sys props
Modified: federation/trunk/picketlink-webapps/sales-post/src/main/webapp/WEB-INF/picketlink-idfed.xml
===================================================================
--- federation/trunk/picketlink-webapps/sales-post/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-05-03 10:13:49 UTC (rev 924)
+++ federation/trunk/picketlink-webapps/sales-post/src/main/webapp/WEB-INF/picketlink-idfed.xml 2011-05-04 02:15:33 UTC (rev 925)
@@ -1,4 +1,4 @@
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:1.0" ServerEnvironment="tomcat">
- <IdentityURL>http://localhost:8080/idp/</IdentityURL>
- <ServiceURL>http://localhost:8080/sales-post/</ServiceURL>
+ <IdentityURL>${idp.url::http://localhost:8080/idp/}</IdentityURL>
+ <ServiceURL>${sales-post.url::http://localhost:8080/sales-post/}</ServiceURL>
</PicketLinkSP>
13 years, 8 months
Picketlink SVN: r924 - in picketlink-seam/trunk/picketlink-seam/src: test/java/org/picketlink/test/identity/seam/federation and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-03 06:13:49 -0400 (Tue, 03 May 2011)
New Revision: 924
Added:
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlMetaDataProviderTestCase.java
Modified:
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMetaDataProvider.java
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
Log:
PLFED-182 MetaDataService throws exception
- Added SamlMetaDataProviderTestCase
- SamlMetaDataProvider.getKeyInfoDOM now adds ds namespace
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMetaDataProvider.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMetaDataProvider.java 2011-05-03 08:29:14 UTC (rev 923)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlMetaDataProvider.java 2011-05-03 10:13:49 UTC (rev 924)
@@ -58,43 +58,47 @@
public void writeMetaData(OutputStream stream)
{
try
- {
- String acsRedirectServiceURL = serviceProvider.getServiceURL(ExternalAuthenticationService.SAML_ASSERTION_CONSUMER_SERVICE);
- IndexedEndpointType acsRedirectEndpoint = new IndexedEndpointType( URI.create( SamlConstants.HTTP_REDIRECT_BINDING ), URI.create( acsRedirectServiceURL ));
+ {
+ String acsRedirectServiceURL = serviceProvider
+ .getServiceURL(ExternalAuthenticationService.SAML_ASSERTION_CONSUMER_SERVICE);
+ IndexedEndpointType acsRedirectEndpoint = new IndexedEndpointType(
+ URI.create(SamlConstants.HTTP_REDIRECT_BINDING), URI.create(acsRedirectServiceURL));
- String acsPostServiceURL = serviceProvider.getServiceURL(ExternalAuthenticationService.SAML_ASSERTION_CONSUMER_SERVICE);
- IndexedEndpointType acsPostEndpoint = new IndexedEndpointType( URI.create( SamlConstants.HTTP_POST_BINDING ), URI.create( acsPostServiceURL ) );
+ String acsPostServiceURL = serviceProvider
+ .getServiceURL(ExternalAuthenticationService.SAML_ASSERTION_CONSUMER_SERVICE);
+ IndexedEndpointType acsPostEndpoint = new IndexedEndpointType(URI.create(SamlConstants.HTTP_POST_BINDING),
+ URI.create(acsPostServiceURL));
- IndexedEndpointType sloRedirectEndpoint = new IndexedEndpointType( URI.create(SamlConstants.HTTP_REDIRECT_BINDING), URI.create(serviceProvider
- .getServiceURL(ExternalAuthenticationService.SAML_SINGLE_LOGOUT_SERVICE)) );
+ IndexedEndpointType sloRedirectEndpoint = new IndexedEndpointType(
+ URI.create(SamlConstants.HTTP_REDIRECT_BINDING), URI.create(serviceProvider
+ .getServiceURL(ExternalAuthenticationService.SAML_SINGLE_LOGOUT_SERVICE)));
- IndexedEndpointType sloPostEndpoint = new IndexedEndpointType( URI.create( SamlConstants.HTTP_POST_BINDING), URI.create( serviceProvider
- .getServiceURL(ExternalAuthenticationService.SAML_SINGLE_LOGOUT_SERVICE)) );
+ IndexedEndpointType sloPostEndpoint = new IndexedEndpointType(URI.create(SamlConstants.HTTP_POST_BINDING),
+ URI.create(serviceProvider.getServiceURL(ExternalAuthenticationService.SAML_SINGLE_LOGOUT_SERVICE)));
List<String> protocolSupport = new ArrayList<String>();
- protocolSupport.add( JBossSAMLURIConstants.PROTOCOL_NSURI.get() );
-
- SPSSODescriptorType spSsoDescriptor = new SPSSODescriptorType( protocolSupport );
+ protocolSupport.add(JBossSAMLURIConstants.PROTOCOL_NSURI.get());
+
+ SPSSODescriptorType spSsoDescriptor = new SPSSODescriptorType(protocolSupport);
spSsoDescriptor.setAuthnRequestsSigned(serviceProvider.getSamlConfiguration().isAuthnRequestsSigned());
spSsoDescriptor.setWantAssertionsSigned(serviceProvider.getSamlConfiguration().isWantAssertionsSigned());
- spSsoDescriptor.addAssertionConsumerService( acsRedirectEndpoint );
- spSsoDescriptor.addAssertionConsumerService( acsPostEndpoint );
- spSsoDescriptor.addSingleLogoutService( sloRedirectEndpoint );
- spSsoDescriptor.addSingleLogoutService( sloPostEndpoint );
+ spSsoDescriptor.addAssertionConsumerService(acsRedirectEndpoint);
+ spSsoDescriptor.addAssertionConsumerService(acsPostEndpoint);
+ spSsoDescriptor.addSingleLogoutService(sloRedirectEndpoint);
+ spSsoDescriptor.addSingleLogoutService(sloPostEndpoint);
- spSsoDescriptor.addNameIDFormat( "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent");
- spSsoDescriptor.addNameIDFormat( "urn:oasis:names:tc:SAML:2.0:nameid-format:transient");
- spSsoDescriptor.addNameIDFormat( "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified");
- spSsoDescriptor.addNameIDFormat( "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress");
-
+ spSsoDescriptor.addNameIDFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent");
+ spSsoDescriptor.addNameIDFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:transient");
+ spSsoDescriptor.addNameIDFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified");
+ spSsoDescriptor.addNameIDFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress");
X509Certificate certificate = serviceProvider.getSamlConfiguration().getCertificate();
- if(certificate == null)
+ if (certificate == null)
throw new RuntimeException("Certificate obtained from configuration is null");
- Element keyInfoElement = getKeyInfoDOM( certificate );
-
+ Element keyInfoElement = getKeyInfoDOM(certificate);
+
/*JAXBElement<byte[]> X509Certificate;
try
{
@@ -113,49 +117,56 @@
KeyDescriptorType keyDescriptor = new KeyDescriptorType();
keyDescriptor.setKeyInfo(keyInfoElement);
-
+
/*keyDescriptor.setUse(KeyTypes.SIGNING);
keyDescriptor.setKeyInfo(keyInfo);*/
- spSsoDescriptor.addKeyDescriptor( keyDescriptor );
+ spSsoDescriptor.addKeyDescriptor(keyDescriptor);
- EDTDescriptorChoiceType edtDescriptorChoice = new EDTDescriptorChoiceType( spSsoDescriptor );
+ EDTDescriptorChoiceType edtDescriptorChoice = new EDTDescriptorChoiceType(spSsoDescriptor);
List<EDTDescriptorChoiceType> edtChoices = new ArrayList<EntityDescriptorType.EDTDescriptorChoiceType>();
edtChoices.add(edtDescriptorChoice);
-
+
EDTChoiceType edtChoice = new EDTChoiceType(edtChoices);
-
- EntityDescriptorType entityDescriptor = new EntityDescriptorType( serviceProvider.getSamlConfiguration().getEntityId());
+
+ EntityDescriptorType entityDescriptor = new EntityDescriptorType(serviceProvider.getSamlConfiguration()
+ .getEntityId());
entityDescriptor.addChoiceType(edtChoice);
-
-
- SAMLMetadataWriter metadataWriter = new SAMLMetadataWriter( StaxUtil.getXMLStreamWriter( stream ) );
+
+ SAMLMetadataWriter metadataWriter = new SAMLMetadataWriter(StaxUtil.getXMLStreamWriter(stream));
metadataWriter.writeEntityDescriptor(entityDescriptor);
-
+
/*JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.federation.saml.v2.metadata");
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(metaDataFactory.createEntityDescriptor(entityDescriptor), stream);*/
}
- catch ( Exception e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}
}
-
- private Element getKeyInfoDOM( X509Certificate certificate )
- {
+
+ private Element getKeyInfoDOM(X509Certificate certificate)
+ {
try
{
- StringBuilder builder = new StringBuilder( "<ds:KeyInfo><ds:X509Data><ds:X509Certificate>");
- builder.append( KeyUtil.encodeAsString( certificate )).append( "</ds:X509Certificate></ds:X509Data></ds:KeyInfo>");
+ // TODO: JA This is not pretty, would prefer to create DOM directly
+ StringBuilder builder = new StringBuilder("<ds:KeyInfo xmlns:ds=\""
+ + JBossSAMLURIConstants.XMLDSIG_NSURI.get() + "\"><ds:X509Data><ds:X509Certificate>");
+ builder.append(KeyUtil.encodeAsString(certificate)).append("</ds:X509Certificate></ds:X509Data></ds:KeyInfo>");
return DocumentUtil.getDocument(builder.toString()).getDocumentElement();
}
- catch ( Exception e)
- {
- throw new RuntimeException( e );
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
}
-
+
}
-}
\ No newline at end of file
+
+ public void setServiceProvider(ServiceProvider serviceProvider)
+ {
+ this.serviceProvider = serviceProvider;
+ }
+}
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java 2011-05-03 08:29:14 UTC (rev 923)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/SamlSingleLogoutSender.java 2011-05-03 10:13:49 UTC (rev 924)
@@ -29,7 +29,6 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.security.Identity;
-import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.newmodel.saml.v2.protocol.LogoutRequestType;
import org.picketlink.identity.seam.federation.configuration.SamlIdentityProvider;
@@ -54,17 +53,10 @@
public void sendSingleLogoutRequestToIDP(HttpServletRequest request, HttpServletResponse response, Identity identity)
{
SeamSamlPrincipal principal = (SeamSamlPrincipal) identity.getPrincipal();
- SamlIdentityProvider idp = (SamlIdentityProvider) principal.getIdentityProvider();
+ SamlIdentityProvider idp = principal.getIdentityProvider();
LogoutRequestType logoutRequest;
- try
- {
- logoutRequest = samlMessageFactory.createLogoutRequest(principal);
- requests.addRequest(logoutRequest.getID(), idp, null);
- }
- catch (ConfigurationException e)
- {
- throw new RuntimeException(e);
- }
+ logoutRequest = samlMessageFactory.createLogoutRequest(principal);
+ requests.addRequest(logoutRequest.getID(), idp, null);
samlMessageSender.sendRequestToIDP(request, response, idp, SamlProfile.SINGLE_LOGOUT, logoutRequest);
}
Modified: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java 2011-05-03 08:29:14 UTC (rev 923)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java 2011-05-03 10:13:49 UTC (rev 924)
@@ -22,11 +22,6 @@
package org.picketlink.test.identity.seam.federation;
import static org.junit.Assert.*;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import static org.hamcrest.CoreMatchers.*;
-
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
@@ -39,11 +34,7 @@
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTChoiceType;
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTDescriptorChoiceType;
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.seam.federation.configuration.Configuration;
import org.picketlink.identity.seam.federation.configuration.SamlConfiguration;
-import org.picketlink.identity.seam.federation.configuration.SamlIdentityProvider;
-import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
-import org.picketlink.identity.seam.federation.jaxb.config.SamlConfigType;
/**
* Unit test the {@link SamlConfiguration} class
Added: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlMetaDataProviderTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlMetaDataProviderTestCase.java (rev 0)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlMetaDataProviderTestCase.java 2011-05-03 10:13:49 UTC (rev 924)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.identity.seam.federation;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+
+import org.junit.Test;
+import org.picketlink.identity.seam.federation.SamlMetaDataProvider;
+import org.picketlink.identity.seam.federation.configuration.Configuration;
+import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
+
+/**
+ * @author Jonas Andersson
+ * @since 29 apr 2011
+ */
+public class SamlMetaDataProviderTestCase
+{
+
+ @Test
+ public void shouldReturnMetaData() throws Exception
+ {
+ Configuration config = new Configuration();
+ config.init();
+
+ SamlMetaDataProvider metaDataProvider = new SamlMetaDataProvider();
+ ServiceProvider serviceProvider = config.getServiceProvider("localhost");
+ assertNotNull(serviceProvider.getSamlConfiguration().getCertificate());
+ metaDataProvider.setServiceProvider(serviceProvider);
+ OutputStream stream = new ByteArrayOutputStream();
+ metaDataProvider.writeMetaData(stream);
+ assertThat(
+ stream.toString(),
+ is("<md:EntityDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:md=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" entityID=\"http://localhost:8080/seam-sp\"><md:SPSSODescriptor protocolSupportEnumeration=\"urn:oasis:names:tc:SAML:2.0:protocol\" WantAuthnRequestsSigned=\"false\" WantAssertionsSigned=\"true\"><md:KeyDescriptor><ds:KeyInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"><ds:X509Data><ds:X509Certificate>MIICRzCCAbCgAwIBAgIES1yEQjANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzELMAkGA1UE\nCBMCQ0ExEDAOBgNVBAcTB1Vua25vd24xDjAMBgNVBAoTBUpCb3NzMRAwDgYDVQQLEwdVbmtub3du\nMRgwFgYDVQQDEw9QaWNrZXRMaW5rIFRlc3QwHhcNMTAwMTI0MTczMjUwWhcNMTAwNDI0MTczMjUw\nWjBoMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB1Vua25vd24xDjAMBgNVBAoT\nBUpCb3NzMRAwDgYDVQQLEwdVbmtub3duMRgwFgYDVQQDEw9QaWNrZXRMaW5rIFRlc3QwgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAKBdNl0jaHPQqz7KydvX0ZI2hqJ+w!
Y9VSeA4uQViPYUvDLQQ\nlN/6XCySQmn4TZj2PDZ7X0Gf3p/wmpeTvcg5xDjAuHYfRLYM4r0maIGGCPMdyT94tqDoL28F+DWq\n1ty4hv/+SUx+rdLBe0r2u+JtVeeBAOxs6HA9ih47dXEu4fV5AgMBAAEwDQYJKoZIhvcNAQEFBQAD\ngYEAKFxUWw/QJA//rUNYjv3fgfQ+Sjhjjdh4lFDuYMcvkSAQLfNBwXy8gTAp+qxzmvgrRALlMMOt\nOzI3D9IuiLZkG/j2l7d7ILhwX210b1sKl4AIf/9wo4vQYlrhzszqYBwt9j7bhOe1Lm2uMJXX6WOP\nKVbytds53HGH/yyzoVz85Yc=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></md:KeyDescriptor><md:SingleLogoutService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\" Location=\"http://localhost:8080null/SingleLogoutService.seam\"></md:SingleLogoutService><md:SingleLogoutService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" Location=\"http://localhost:8080null/SingleLogoutService.seam\"></md:SingleLogoutService><md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat><md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat><md:NameIDFormat>urn:oasis:names:tc:SAML:2.!
0:nameid-format:unspecified</md:NameIDFormat><md:NameIDFormat>!
urn:oasi
s:names:tc:SAML:2.0:nameid-format:emailAddress</md:NameIDFormat><md:AssertionConsumerService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\" Location=\"http://localhost:8080null/AssertionConsumerService.seam\" index=\"0\"></md:AssertionConsumerService><md:AssertionConsumerService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" Location=\"http://localhost:8080null/AssertionConsumerService.seam\" index=\"0\"></md:AssertionConsumerService></md:SPSSODescriptor></md:EntityDescriptor>"));
+ }
+}
13 years, 8 months
Picketlink SVN: r923 - picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-03 04:29:14 -0400 (Tue, 03 May 2011)
New Revision: 923
Modified:
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java
Log:
PLFED-180
seam-sp crashes on missing defaultIdentityProvider even though it is marked as optional
PLFED-181
Leading slash of saml-entitites.xml, external-authentication.xml and external-authentication.xsd does not work in ear (or unit test)
- Fixed unessecary import
Modified: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java 2011-05-03 08:28:09 UTC (rev 922)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java 2011-05-03 08:29:14 UTC (rev 923)
@@ -25,7 +25,6 @@
import org.junit.Test;
import org.picketlink.identity.seam.federation.configuration.Configuration;
-import org.picketlink.identity.seam.federation.configuration.SamlConfiguration;
import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
/**
13 years, 8 months
Picketlink SVN: r922 - in picketlink-seam/trunk: picketlink-seam and 5 other directories.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-03 04:28:09 -0400 (Tue, 03 May 2011)
New Revision: 922
Added:
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/identity/
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/identity/seam/
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.out.xml
picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.xml
picketlink-seam/trunk/picketlink-seam/src/test/resources/picketlink_test_keystore.jks
Removed:
picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
Modified:
picketlink-seam/trunk/
picketlink-seam/trunk/picketlink-seam/
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java
picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java
Log:
PLFED-180
seam-sp crashes on missing defaultIdentityProvider even though it is marked as optional
PLFED-181
Leading slash of saml-entitites.xml, external-authentication.xml and external-authentication.xsd does not work in ear (or unit test)
- New ConfigurationTestCase
- defaultIdentityProvider is now optional
- defaultOpenIdProvider is now optional
- Path to external-authentication-config.xml now has no leading /
- Path to external-authentication-config.xsd now has no leading /
- Path to saml-entities.xml now has no leading /
Property changes on: picketlink-seam/trunk
___________________________________________________________________
Modified: svn:ignore
- .classpath
.settings
target
target-eclipse
eclipse-target
generated-source
+ .classpath
.settings
target
target-eclipse
eclipse-target
generated-source
.project
Property changes on: picketlink-seam/trunk/picketlink-seam
___________________________________________________________________
Added: svn:ignore
+ target
.classpath
.project
.settings
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java 2011-05-03 07:04:35 UTC (rev 921)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -45,6 +45,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.web.ServletContexts;
+import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.util.StringUtil;
import org.picketlink.identity.seam.federation.jaxb.config.ExternalAuthenticationConfigType;
import org.picketlink.identity.seam.federation.jaxb.config.ServiceProviderType;
@@ -62,14 +63,16 @@
@Import("org.picketlink.identity.seam.federation")
public class Configuration
{
- private final static String CONFIGURATION_FILE = "/external-authentication-config.xml";
+ private static final String SCHEMA_CONFIG_EXTERNAL_AUTHENTICATION_CONFIG_XSD = "schema/config/external-authentication-config.xsd";
+ private final static String CONFIGURATION_FILE = "external-authentication-config.xml";
+
private String contextRoot;
private Map<String, ServiceProvider> serviceProviderMap = new HashMap<String, ServiceProvider>();
@Create
- public void init()
+ public void init() throws ConfigurationException
{
List<ServiceProvider> serviceProviders = new LinkedList<ServiceProvider>();
ExternalAuthenticationConfigType externalAuthenticationConfig = readConfigurationFile();
@@ -90,14 +93,14 @@
}
}
- private ExternalAuthenticationConfigType readConfigurationFile()
+ private ExternalAuthenticationConfigType readConfigurationFile() throws ConfigurationException
{
ExternalAuthenticationConfigType externalAuthenticationConfig;
try
{
JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.seam.federation.jaxb.config");
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- URL schemaURL = PicketLinkSeamUtil.loadResource(getClass(), "/schema/config/external-authentication-config.xsd" );
+ URL schemaURL = loadResourceThrowIfNotFound(SCHEMA_CONFIG_EXTERNAL_AUTHENTICATION_CONFIG_XSD);
Schema schema;
try
{
@@ -109,7 +112,7 @@
}
unmarshaller.setSchema(schema);
- JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal( PicketLinkSeamUtil.loadResource( getClass(), CONFIGURATION_FILE));
+ JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal( loadResourceThrowIfNotFound(CONFIGURATION_FILE));
externalAuthenticationConfig = (ExternalAuthenticationConfigType) o.getValue();
}
catch (JAXBException e)
@@ -119,6 +122,14 @@
return externalAuthenticationConfig;
}
+ private URL loadResourceThrowIfNotFound(String resource) throws ConfigurationException
+ {
+ URL url = PicketLinkSeamUtil.loadResource(getClass(), resource );
+ if (url == null)
+ throw new ConfigurationException("Resource \"" + resource + "\" could not be loaded");
+ return url;
+ }
+
public static Configuration instance()
{
return (Configuration) Component.getInstance(Configuration.class);
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java 2011-05-03 07:04:35 UTC (rev 921)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -40,7 +40,8 @@
public OpenIdConfiguration(OpenIdConfigType openIdConfig)
{
attributes = openIdConfig.getAttribute();
- defaultOpenIdProvider = StringUtil.getSystemPropertyAsString( openIdConfig.getDefaultOpenIdProvider() );
+ if (openIdConfig.getDefaultOpenIdProvider() != null)
+ defaultOpenIdProvider = StringUtil.getSystemPropertyAsString(openIdConfig.getDefaultOpenIdProvider());
}
public List<OpenIdAttributeType> getAttributes()
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java 2011-05-03 07:04:35 UTC (rev 921)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -37,6 +37,7 @@
import java.util.List;
import java.util.Map;
+import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.parsers.saml.SAMLParser;
import org.picketlink.identity.federation.core.util.StringUtil;
import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntitiesDescriptorType;
@@ -55,7 +56,7 @@
*/
public class SamlConfiguration
{
- private static final String SAML_ENTITIES_FILE = "/saml-entities.xml";
+ private static final String SAML_ENTITIES_FILE = "saml-entities.xml";
private Map<String, IDPSSODescriptorType> idpMetaInfo = new HashMap<String, IDPSSODescriptorType>();
@@ -73,24 +74,24 @@
private X509Certificate certificate;
- public SamlConfiguration(SamlConfigType samlConfig)
+ public SamlConfiguration(SamlConfigType samlConfig) throws ConfigurationException
{
readSamlMetaInformation();
- this.entityId = StringUtil.getSystemPropertyAsString( samlConfig.getServiceProviderEntityId() );
+ this.entityId = StringUtil.getSystemPropertyAsString(samlConfig.getServiceProviderEntityId());
this.authnRequestsSigned = samlConfig.isAuthnRequestsSigned();
this.wantAssertionsSigned = samlConfig.isWantAssertionsSigned();
for (SamlIdentityProviderType samlIdp : samlConfig.getSamlIdentityProvider())
{
- String entityID = StringUtil.getSystemPropertyAsString( samlIdp.getEntityId() );
- IDPSSODescriptorType idpSsoDescriptor = idpMetaInfo.get( entityID );
+ String entityID = StringUtil.getSystemPropertyAsString(samlIdp.getEntityId());
+ IDPSSODescriptorType idpSsoDescriptor = idpMetaInfo.get(entityID);
if (idpSsoDescriptor == null)
{
throw new RuntimeException("Saml identity provider with entity id \"" + entityID
+ "\" not found in metadata.");
}
- SamlIdentityProvider samlIdentityProvider = new SamlIdentityProvider( entityID, idpSsoDescriptor);
+ SamlIdentityProvider samlIdentityProvider = new SamlIdentityProvider(entityID, idpSsoDescriptor);
identityProviders.add(samlIdentityProvider);
samlIdentityProvider.setWantSingleLogoutMessagesSigned(samlIdp.isWantSingleLogoutMessagesSigned());
@@ -108,8 +109,9 @@
wantAuthnRequestsSigned = true;
}
}
- String entityID = StringUtil.getSystemPropertyAsString( identityProvider.getEntityId() );
- if ( entityID.equals( StringUtil.getSystemPropertyAsString( samlConfig.getDefaultIdentityProvider() )))
+ String entityID = StringUtil.getSystemPropertyAsString(identityProvider.getEntityId());
+ if (samlConfig.getDefaultIdentityProvider() != null
+ && entityID.equals(StringUtil.getSystemPropertyAsString(samlConfig.getDefaultIdentityProvider())))
{
defaultIdentityProvider = identityProvider;
}
@@ -121,10 +123,10 @@
"Configuration error: at least one identity provider wants the authentication requests signed, but the service provider doesn't sign authentication requests.");
}
- String keyStoreUrl = StringUtil.getSystemPropertyAsString( samlConfig.getKeyStoreUrl() );
- String keyStorePass = StringUtil.getSystemPropertyAsString( samlConfig.getKeyStorePass() );
- String signingKeyAlias = StringUtil.getSystemPropertyAsString( samlConfig.getSigningKeyAlias() );
- String signingKeyPass = StringUtil.getSystemPropertyAsString( samlConfig.getSigningKeyPass() );
+ String keyStoreUrl = StringUtil.getSystemPropertyAsString(samlConfig.getKeyStoreUrl());
+ String keyStorePass = StringUtil.getSystemPropertyAsString(samlConfig.getKeyStorePass());
+ String signingKeyAlias = StringUtil.getSystemPropertyAsString(samlConfig.getSigningKeyAlias());
+ String signingKeyPass = StringUtil.getSystemPropertyAsString(samlConfig.getSigningKeyPass());
if (signingKeyPass == null)
{
signingKeyPass = keyStorePass;
@@ -137,13 +139,13 @@
{
try
{
- InputStream samlEntitiesStream = PicketLinkSeamUtil.loadResourceAsStream( getClass(), SAML_ENTITIES_FILE );
- if( samlEntitiesStream == null )
- throw new RuntimeException( "SAML Entities File is missing" );
-
+ InputStream samlEntitiesStream = PicketLinkSeamUtil.loadResourceAsStream(getClass(), SAML_ENTITIES_FILE);
+ if (samlEntitiesStream == null)
+ throw new RuntimeException("SAML Entities File is missing");
+
SAMLParser samlParser = new SAMLParser();
- EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) samlParser.parse( samlEntitiesStream );
-
+ EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) samlParser.parse(samlEntitiesStream);
+
/*JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.federation.saml.v2.metadata");
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(getClass().getResource(SAML_ENTITIES_FILE));
@@ -151,7 +153,7 @@
*/
readEntitiesDescriptor(entitiesDescriptor);
}
- catch ( Exception e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}
@@ -159,23 +161,23 @@
private void readEntitiesDescriptor(EntitiesDescriptorType entitiesDescriptor)
{
- for (Object object : entitiesDescriptor.getEntityDescriptor() )
+ for (Object object : entitiesDescriptor.getEntityDescriptor())
{
if (object instanceof EntityDescriptorType)
{
EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
String entityId = entityDescriptor.getEntityID();
-
- for( EDTChoiceType edt: entityDescriptor.getChoiceType() )
+
+ for (EDTChoiceType edt : entityDescriptor.getChoiceType())
{
List<EDTDescriptorChoiceType> descriptors = edt.getDescriptors();
- for( EDTDescriptorChoiceType edtDesc : descriptors )
+ for (EDTDescriptorChoiceType edtDesc : descriptors)
{
IDPSSODescriptorType idpSSODesc = edtDesc.getIdpDescriptor();
- if( idpSSODesc != null )
- {
+ if (idpSSODesc != null)
+ {
idpMetaInfo.put(entityId, idpSSODesc);
- }
+ }
}
}
@@ -197,7 +199,7 @@
}
}
- private void getSigningKeyPair(String keyStoreUrl, String keyStorePass, String signingKeyAlias, String signingKeyPass)
+ private void getSigningKeyPair(String keyStoreUrl, String keyStorePass, String signingKeyAlias, String signingKeyPass) throws ConfigurationException
{
final String classPathPrefix = "classpath:";
@@ -207,13 +209,15 @@
InputStream keyStoreStream;
if (keyStoreUrl.startsWith(classPathPrefix))
{
- keyStoreStream = PicketLinkSeamUtil.loadResourceAsStream( getClass(),
+ keyStoreStream = PicketLinkSeamUtil.loadResourceAsStream(getClass(),
keyStoreUrl.substring(classPathPrefix.length()));
}
else
{
keyStoreStream = new URL(keyStoreUrl).openStream();
}
+ if (keyStoreStream == null)
+ throw new ConfigurationException("Could not load keystore resource \"" + keyStoreUrl + "\"");
char[] keyStorePwd = keyStorePass != null ? keyStorePass.toCharArray() : null;
keyStore.load(keyStoreStream, keyStorePwd);
@@ -291,7 +295,7 @@
if (identityProvider instanceof SamlIdentityProvider)
{
SamlIdentityProvider samlIdentityProvider = (SamlIdentityProvider) identityProvider;
- if ( StringUtil.getSystemPropertyAsString( samlIdentityProvider.getEntityId() ).equals(entityId))
+ if (StringUtil.getSystemPropertyAsString(samlIdentityProvider.getEntityId()).equals(entityId))
{
return samlIdentityProvider;
}
Modified: picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java 2011-05-03 07:04:35 UTC (rev 921)
+++ picketlink-seam/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -28,6 +28,7 @@
import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Expressions.MethodExpression;
+import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.util.StringUtil;
import org.picketlink.identity.seam.federation.ExternalAuthenticationService;
import org.picketlink.identity.seam.federation.jaxb.config.ServiceProviderType;
@@ -60,7 +61,7 @@
private MethodExpression<Boolean> internalAuthenticationMethod;
- public ServiceProvider(Configuration configuration, ServiceProviderType serviceProvider)
+ public ServiceProvider(Configuration configuration, ServiceProviderType serviceProvider) throws ConfigurationException
{
this.configuration = configuration;
Added: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java (rev 0)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/ConfigurationTestCase.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.identity.seam.federation;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.picketlink.identity.seam.federation.configuration.Configuration;
+import org.picketlink.identity.seam.federation.configuration.SamlConfiguration;
+import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
+
+/**
+ * @author Jonas Andersson
+ * @since 29 apr 2011
+ */
+public class ConfigurationTestCase
+{
+ @Test
+ public void shouldReadSamlEntitiesWithoutDefaultIDP() throws Exception
+ {
+ Configuration config = new Configuration();
+ config.init();
+ ServiceProvider serviceProvider = config.getServiceProvider("localhost");
+ assertNull(serviceProvider.getSamlConfiguration().getDefaultIdentityProvider());
+ assertNull(serviceProvider.getOpenIdConfiguration().getDefaultOpenIdProvider());
+ }
+}
Deleted: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java 2011-05-03 07:04:35 UTC (rev 921)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.picketlink.test.identity.seam.federation;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Test;
-import org.picketlink.identity.federation.core.parsers.saml.SAMLParser;
-import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntitiesDescriptorType;
-import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTChoiceType;
-import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTDescriptorChoiceType;
-import org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.seam.federation.configuration.SamlConfiguration;
-
-/**
- * Unit test the {@link SamlConfiguration} class
- * @author Anil.Saldhana(a)redhat.com
- * @since Feb 7, 2011
- */
-public class SamlConfigurationUnitTestCase
-{
- private Map<String, IDPSSODescriptorType> idpMetaInfo = new HashMap<String, IDPSSODescriptorType>();
-
- @Test
- public void testSamlConfig() throws Exception
- {
- InputStream samlEntitiesStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( "saml-entities.xml" );
- if( samlEntitiesStream == null )
- throw new RuntimeException( "SAML Entities File is missing" );
-
- SAMLParser samlParser = new SAMLParser();
- EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) samlParser.parse( samlEntitiesStream );
- assertNotNull( entitiesDescriptor );
- readEntitiesDescriptor(entitiesDescriptor);
- assertTrue( idpMetaInfo.keySet().size() > 0 );
- }
-
- private void readEntitiesDescriptor(EntitiesDescriptorType entitiesDescriptor)
- {
- for (Object object : entitiesDescriptor.getEntityDescriptor() )
- {
- if (object instanceof EntityDescriptorType)
- {
- EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
- String entityId = entityDescriptor.getEntityID();
-
- for( EDTChoiceType edt: entityDescriptor.getChoiceType() )
- {
- List<EDTDescriptorChoiceType> descriptors = edt.getDescriptors();
- for( EDTDescriptorChoiceType edtDesc : descriptors )
- {
- IDPSSODescriptorType idpSSODesc = edtDesc.getIdpDescriptor();
- if( idpSSODesc != null )
- {
- idpMetaInfo.put(entityId, idpSSODesc);
- }
- }
- }
-
- /*for (RoleDescriptorType roleDescriptor : entityDescriptor.getC
- .getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor())
- {
- if (roleDescriptor instanceof IDPSSODescriptorType)
- {
- IDPSSODescriptorType IDPSSODescriptor = (IDPSSODescriptorType) roleDescriptor;
- idpMetaInfo.put(entityId, IDPSSODescriptor);
- }
- }*/
- }
- else
- {
- EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
- readEntitiesDescriptor(descriptor);
- }
- }
- }
-}
\ No newline at end of file
Added: picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java (rev 0)
+++ picketlink-seam/trunk/picketlink-seam/src/test/java/org/picketlink/test/identity/seam/federation/SamlConfigurationUnitTestCase.java 2011-05-03 08:28:09 UTC (rev 922)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.identity.seam.federation;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import static org.hamcrest.CoreMatchers.*;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.picketlink.identity.federation.core.parsers.saml.SAMLParser;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntitiesDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTChoiceType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTDescriptorChoiceType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
+import org.picketlink.identity.seam.federation.configuration.Configuration;
+import org.picketlink.identity.seam.federation.configuration.SamlConfiguration;
+import org.picketlink.identity.seam.federation.configuration.SamlIdentityProvider;
+import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
+import org.picketlink.identity.seam.federation.jaxb.config.SamlConfigType;
+
+/**
+ * Unit test the {@link SamlConfiguration} class
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 7, 2011
+ */
+public class SamlConfigurationUnitTestCase
+{
+ private Map<String, IDPSSODescriptorType> idpMetaInfo = new HashMap<String, IDPSSODescriptorType>();
+
+ @Test
+ public void testSamlConfig() throws Exception
+ {
+ InputStream samlEntitiesStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( "saml-entities.xml" );
+ if( samlEntitiesStream == null )
+ throw new RuntimeException( "SAML Entities File is missing" );
+
+ SAMLParser samlParser = new SAMLParser();
+ EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) samlParser.parse( samlEntitiesStream );
+ assertNotNull( entitiesDescriptor );
+ readEntitiesDescriptor(entitiesDescriptor);
+ assertTrue( idpMetaInfo.keySet().size() > 0 );
+ }
+
+ private void readEntitiesDescriptor(EntitiesDescriptorType entitiesDescriptor)
+ {
+ for (Object object : entitiesDescriptor.getEntityDescriptor() )
+ {
+ if (object instanceof EntityDescriptorType)
+ {
+ EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
+ String entityId = entityDescriptor.getEntityID();
+
+ for( EDTChoiceType edt: entityDescriptor.getChoiceType() )
+ {
+ List<EDTDescriptorChoiceType> descriptors = edt.getDescriptors();
+ for( EDTDescriptorChoiceType edtDesc : descriptors )
+ {
+ IDPSSODescriptorType idpSSODesc = edtDesc.getIdpDescriptor();
+ if( idpSSODesc != null )
+ {
+ idpMetaInfo.put(entityId, idpSSODesc);
+ }
+ }
+ }
+
+ /*for (RoleDescriptorType roleDescriptor : entityDescriptor.getC
+ .getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor())
+ {
+ if (roleDescriptor instanceof IDPSSODescriptorType)
+ {
+ IDPSSODescriptorType IDPSSODescriptor = (IDPSSODescriptorType) roleDescriptor;
+ idpMetaInfo.put(entityId, IDPSSODescriptor);
+ }
+ }*/
+ }
+ else
+ {
+ EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
+ readEntitiesDescriptor(descriptor);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.out.xml
===================================================================
Added: picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.xml
===================================================================
--- picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.xml (rev 0)
+++ picketlink-seam/trunk/picketlink-seam/src/test/resources/external-authentication-config.xml 2011-05-03 08:28:09 UTC (rev 922)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ExternalAuthenticationConfig
+ xmlns="urn:picketlink:identity-federation:seam:config:1.0" xmlns:tns="urn:picketlink:identity-federation:seam:config:1.0">
+ <!--
+ Service provider running at localhost. Uses an IDP selected by the
+ user (SAML or OpenID)
+ -->
+ <ServiceProvider protocol="http" hostname="localhost"
+ unsolicitedAuthenticationUrl="http://saml.picketlink.org:8080/seam-sp/PublicPage.seam"
+ loggedOutUrl="http://localhost:8080/seam-sp/PublicPage.seam"
+ failedAuthenticationUrl="http://localhost:8080/seam-sp/FailedAuthenticationPage.seam"
+ internalAuthenticationMethod="#{authenticator.internalAuthenticate}">
+ <SamlConfig serviceProviderEntityId="http://localhost:8080/seam-sp"
+ keyStoreUrl="classpath:picketlink_test_keystore.jks" keyStorePass="store456"
+ signingKeyAlias="servercert" signingKeyPass="pass456">
+ <SamlIdentityProvider entityId="http://idp.ssocircle.com" />
+ <SamlIdentityProvider entityId="http://localhost:8888/opensso" />
+ </SamlConfig>
+ <OpenIdConfig>
+ <Attribute Alias="name" TypeUri="http://schema.openid.net/namePerson"
+ Required="true" />
+ <Attribute Alias="email" TypeUri="http://schema.openid.net/contact/email"
+ Required="true" />
+ </OpenIdConfig>
+ </ServiceProvider>
+ <!--
+ Service provider running at saml.picketlink.org (map this hostname to
+ 127.0.0.1 in /etc/hosts). Uses one SAML identity provider: SSOCircle.
+ -->
+ <ServiceProvider protocol="http" hostname="saml.picketlink.org"
+ unsolicitedAuthenticationUrl="http://saml.picketlink.org:8080/seam-sp/PublicPage.seam"
+ loggedOutUrl="http://saml.picketlink.org:8080/seam-sp/PublicPage.seam"
+ failedAuthenticationUrl="http://saml.picketlink.org:8080/seam-sp/FailedAuthenticationPage.seam"
+ internalAuthenticationMethod="#{authenticator.internalAuthenticate}">
+ <SamlConfig serviceProviderEntityId="http://saml.picketlink.org:8080/seam-sp"
+ authnRequestsSigned="false" defaultIdentityProvider="http://idp.ssocircle.com"
+ keyStoreUrl="classpath:picketlink_test_keystore.jks" keyStorePass="store456"
+ signingKeyAlias="servercert" signingKeyPass="pass456">
+ <SamlIdentityProvider entityId="http://idp.ssocircle.com" />
+ </SamlConfig>
+ </ServiceProvider>
+ <!--
+ Service provider running at openid.picketlink.org (map this hostname
+ to 127.0.0.1 in /etc/hosts). Uses one OpenID identity provider:
+ Google.
+ -->
+ <ServiceProvider protocol="http" hostname="openid.picketlink.org"
+ unsolicitedAuthenticationUrl="http://saml.picketlink.org:8080/seam-sp/PublicPage.seam"
+ loggedOutUrl="http://openid.picketlink.org:8080/seam-sp/PublicPage.seam"
+ failedAuthenticationUrl="http://openid.picketlink.org:8080/seam-sp/FailedAuthenticationPage.seam"
+ internalAuthenticationMethod="#{authenticator.internalAuthenticate}">
+ <OpenIdConfig defaultOpenIdProvider="https://www.google.com/accounts/o8/id" />
+ </ServiceProvider>
+ <ServiceProvider protocol="http" hostname="facebook.picketlink.org"
+ unsolicitedAuthenticationUrl="http://facebook.picketlink.org:8080/seam-sp/PublicPage.seam"
+ loggedOutUrl="http://facebook.picketlink.org:8080/seam-sp/PublicPage.seam"
+ failedAuthenticationUrl="http://facebook.picketlink.org:8080/seam-sp/FailedAuthenticationPage.seam"
+ internalAuthenticationMethod="#{authenticator.internalAuthenticate}">
+ <FacebookConfig clientId="156872394341240"
+ clientSecret="7b6919b80e544f0faf2ee05875f48f46" scope="email publish_stream"/>
+ </ServiceProvider>
+</ExternalAuthenticationConfig>
Added: picketlink-seam/trunk/picketlink-seam/src/test/resources/picketlink_test_keystore.jks
===================================================================
(Binary files differ)
Property changes on: picketlink-seam/trunk/picketlink-seam/src/test/resources/picketlink_test_keystore.jks
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 8 months
Picketlink SVN: r921 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util.
by picketlink-commits@lists.jboss.org
Author: jonananas
Date: 2011-05-03 03:04:35 -0400 (Tue, 03 May 2011)
New Revision: 921
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/SAMLMetadataUtil.java
Log:
PLFED-179 Loading of saml-entities.xml fails when certificate contains tabs
getCerticate now removes all whitespace from certificate before decoding
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/SAMLMetadataUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/SAMLMetadataUtil.java 2011-04-26 18:54:27 UTC (rev 920)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/SAMLMetadataUtil.java 2011-05-03 07:04:35 UTC (rev 921)
@@ -76,7 +76,7 @@
{
Node certNode = nl.getFirstChild();
String certNodeValue = certNode.getNodeValue();
- cert = XMLSignatureUtil.getX509CertificateFromKeyInfoString( certNodeValue.trim() );
+ cert = XMLSignatureUtil.getX509CertificateFromKeyInfoString( certNodeValue.replaceAll("\\s", ""));
break;
}
}
13 years, 8 months