cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/2] git commit: updated refs/heads/saml2 to 2637186
Date Mon, 25 Aug 2014 01:06:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/saml2 67cfb568e -> 2637186f1


SAMLUtils: Create new NameID using passed nameId taking just id and session idx

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


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

Branch: refs/heads/saml2
Commit: dfd5be24652a5c757bad9a029d68fcd7b71ff5bf
Parents: 67cfb56
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Mon Aug 25 02:39:50 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Aug 25 02:39:50 2014 +0200

----------------------------------------------------------------------
 utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dfd5be24/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
index a238c82..51cf507 100644
--- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
+++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
@@ -40,6 +40,7 @@ import org.opensaml.saml2.core.impl.AuthnContextClassRefBuilder;
 import org.opensaml.saml2.core.impl.AuthnRequestBuilder;
 import org.opensaml.saml2.core.impl.IssuerBuilder;
 import org.opensaml.saml2.core.impl.LogoutRequestBuilder;
+import org.opensaml.saml2.core.impl.NameIDBuilder;
 import org.opensaml.saml2.core.impl.NameIDPolicyBuilder;
 import org.opensaml.saml2.core.impl.RequestedAuthnContextBuilder;
 import org.opensaml.saml2.core.impl.SessionIndexBuilder;
@@ -138,7 +139,7 @@ public class SAMLUtils {
         return authnRequest;
     }
 
-    public static LogoutRequest buildLogoutRequest(String logoutUrl, String spId, NameID
nameId, String sessionIndex) {
+    public static LogoutRequest buildLogoutRequest(String logoutUrl, String spId, NameID
sessionNameId, String sessionIndex) {
         IssuerBuilder issuerBuilder = new IssuerBuilder();
         Issuer issuer = issuerBuilder.buildObject();
         issuer.setValue(spId);
@@ -146,6 +147,10 @@ public class SAMLUtils {
         SessionIndex sessionIndexElement = new SessionIndexBuilder().buildObject();
         sessionIndexElement.setSessionIndex(sessionIndex);
 
+        NameID nameID = new NameIDBuilder().buildObject();
+        nameID.setValue(sessionNameId.getValue());
+        nameID.setFormat(sessionNameId.getFormat());
+
         LogoutRequest logoutRequest = new LogoutRequestBuilder().buildObject();
         logoutRequest.setID(generateSecureRandomId());
         logoutRequest.setDestination(logoutUrl);
@@ -153,7 +158,7 @@ public class SAMLUtils {
         logoutRequest.setIssueInstant(new DateTime());
         logoutRequest.setIssuer(issuer);
         logoutRequest.getSessionIndexes().add(sessionIndexElement);
-        logoutRequest.setNameID(nameId);
+        logoutRequest.setNameID(nameID);
         return logoutRequest;
     }
 


Mime
View raw message