Author: marcelkolsteren
Date: 2009-08-16 06:00:01 -0400 (Sun, 16 Aug 2009)
New Revision: 706
Modified:
identity-federation/trunk/jboss-identity-seam/src/main/java/org/jboss/identity/seam/federation/SamlAuthenticationFilter.java
Log:
Fixes in SamlAuthenticationFilter:
- added property singleSignOnServiceURL
- support for keystore that has no password
Modified:
identity-federation/trunk/jboss-identity-seam/src/main/java/org/jboss/identity/seam/federation/SamlAuthenticationFilter.java
===================================================================
---
identity-federation/trunk/jboss-identity-seam/src/main/java/org/jboss/identity/seam/federation/SamlAuthenticationFilter.java 2009-08-14
05:44:28 UTC (rev 705)
+++
identity-federation/trunk/jboss-identity-seam/src/main/java/org/jboss/identity/seam/federation/SamlAuthenticationFilter.java 2009-08-16
10:00:01 UTC (rev 706)
@@ -98,6 +98,8 @@
* <dl>
* <dt>identityProviderURL</dt>
* <dd>URL of the identity provider.</dd>
+ * <dt>singleSignOnServiceURL</dt>
+ * <dd>URL of the SSO Service of the identity provider.</dd>
* <dt>keyStoreURL</dt>
* <dd>URL of the keystore.</dd>
* <dt>keyStorePass</dt>
@@ -125,6 +127,8 @@
private String identityProviderURL;
+ private String singleSignOnServiceURL;
+
private String keyStoreURL;
private String keyStorePass;
@@ -426,7 +430,7 @@
try
{
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
- keyStore.load(new URL(keyStoreURL).openStream(), keyStorePass.toCharArray());
+ keyStore.load(new URL(keyStoreURL).openStream(), keyStorePass != null ?
keyStorePass.toCharArray() : null);
return keyStore.getCertificate(idpCertificateAlias).getPublicKey();
}
catch (KeyStoreException e)
@@ -469,19 +473,18 @@
saml2Request.marshall(authnRequest, baos);
String samlMessage = PostBindingUtil.base64Encode(baos.toString());
- String destination = authnRequest.getDestination();
if (binding == Binding.HTTP_Redirect)
{
String deflatedRequest =
RedirectBindingUtil.deflateBase64URLEncode(baos.toByteArray());
StringBuilder sb = new StringBuilder();
sb.append("?SAMLRequest=").append(deflatedRequest);
sb.append("&RelayState=").append(relayState);
- HTTPRedirectUtil.sendRedirectForRequestor(destination + sb.toString(),
response);
+ HTTPRedirectUtil.sendRedirectForRequestor(singleSignOnServiceURL +
sb.toString(), response);
}
else
{
- DestinationInfoHolder destinationInfoHolder = new
DestinationInfoHolder(destination, samlMessage, Integer
- .toString(relayState));
+ DestinationInfoHolder destinationInfoHolder = new
DestinationInfoHolder(singleSignOnServiceURL,
+ samlMessage, Integer.toString(relayState));
PostBindingUtil.sendPost(destinationInfoHolder, response, true);
}
}
Show replies by date