SAML2UserAuthenticator: check that request params has SAMLResponse

Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ad13d3d7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ad13d3d7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ad13d3d7

Branch: refs/heads/master
Commit: ad13d3d7472bcb2361ba97914fa5c5c90b5429ca
Parents: 7ee4176
Author: Rohit Yadav <rohit.ya...@shapeblue.com>
Authored: Mon Aug 25 01:57:24 2014 +0200
Committer: Rohit Yadav <rohit.ya...@shapeblue.com>
Committed: Thu Aug 28 19:45:26 2014 +0200

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ad13d3d7/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
----------------------------------------------------------------------
diff --git 
a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
 
b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
index a4902d1..5cd9b52 100644
--- 
a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
+++ 
b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
@@ -48,8 +48,8 @@ public class SAML2UserAuthenticator extends 
DefaultUserAuthenticator {
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, 
null);
         } else {
             User user = _userDao.getUser(userAccount.getId());
-            // TODO: check SAMLRequest, signature etc. from requestParameters
-            if (user != null && SAMLUtils.checkSAMLUserId(user.getUuid())) {
+            if (user != null && SAMLUtils.checkSAMLUserId(user.getUuid()) &&
+                    requestParameters.containsKey(SAMLUtils.SAML_RESPONSE)) {
                 return new Pair<Boolean, ActionOnFailedAuthentication>(true, 
null);
             }
         }

Reply via email to