cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [44/52] git commit: updated refs/heads/saml2 to 1d809ff
Date Mon, 25 Aug 2014 15:36:40 GMT
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/e1af2b2a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e1af2b2a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e1af2b2a

Branch: refs/heads/saml2
Commit: e1af2b2ae1fa0fc1a77ca6c0091d16c106d28933
Parents: aafc1aa
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 17:33:29 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/e1af2b2a/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