Author: pcraveiro
Date: 2011-12-02 09:53:40 -0500 (Fri, 02 Dec 2011)
New Revision: 1329
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java
Log:
http://community.jboss.org/message/639402
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java
===================================================================
---
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java 2011-11-30
03:51:50 UTC (rev 1328)
+++
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java 2011-12-02
14:53:40 UTC (rev 1329)
@@ -206,8 +206,25 @@
{
//Get the signing key
PrivateKey signingKey = keyManager.getSigningKey();
- String url =
RedirectBindingSignatureUtil.getSAMLRequestURLWithSignature(urlEncodedRequest,
- urlEncodedRelayState, signingKey);
+
+ if (signingKey == null) {
+ log.error("Signing key is null. Check your KeyStore
configuration.");
+ throw new RuntimeException(ErrorCodes.SIGNING_PROCESS_FAILURE);
+ }
+
+ String url = null;
+
+ if (sendRequest)
+ {
+ url =
RedirectBindingSignatureUtil.getSAMLRequestURLWithSignature(urlEncodedRequest,
urlEncodedRelayState,
+ signingKey);
+ }
+ else
+ {
+ url =
RedirectBindingSignatureUtil.getSAMLResponseURLWithSignature(urlEncodedRequest,
urlEncodedRelayState,
+ signingKey);
+ }
+
return url;
}
catch (Exception e)