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/saml-production-grade to b8b21aa
Date Wed, 03 Jun 2015 18:30:56 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/saml-production-grade d80634cc6 -> b8b21aa99


CLOUDSTACK-8458: On UI show dropdown list of discovered IdPs

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/79ef7f36
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/79ef7f36
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/79ef7f36

Branch: refs/heads/saml-production-grade
Commit: 79ef7f360f1945017cce0ebbcb27c8cec6bd20b7
Parents: d80634c
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Wed Jun 3 20:23:19 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed Jun 3 20:23:19 2015 +0200

----------------------------------------------------------------------
 ui/index.jsp                  |  7 ++++++-
 ui/scripts/cloudStack.js      |  2 +-
 ui/scripts/ui-custom/login.js | 13 ++++++++++++-
 3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79ef7f36/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index 4b601a5..e4f2985 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -68,7 +68,12 @@
                         </div>
                         <!-- Submit (login) -->
                         <input type="submit" value="<fmt:message key="label.login"/>"
/>
-                        <div id="saml-login"><input type="samlsubmit" value="<fmt:message
key="label.saml.login"/>"/></div>
+                        <div id="saml-login">
+                            <select id="saml-idps" style="margin-top: 20px">
+                                <option value=""></option> <!-- when this
blank option is selected, default IdP will be used -->
+                            </select>
+                            <input type="samlsubmit" value="<fmt:message key="label.saml.login"/>"/>
+                        </div>
                         <!-- Select language -->
                         <div class="select-language">
                             <select name="language">

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79ef7f36/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index d89f487..28be71c 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -371,7 +371,7 @@
                 $.cookie('domainid', null);
                 $.cookie('role', null);
                 $.cookie('timezone', null);
-                window.location.href = createURL('samlSso');
+                window.location.href = createURL('samlSso&idpid=' + args.data.idpid);
             },
 
             // Show cloudStack main UI widget

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79ef7f36/ui/scripts/ui-custom/login.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/login.js b/ui/scripts/ui-custom/login.js
index 1f82c82..90a19ab 100644
--- a/ui/scripts/ui-custom/login.js
+++ b/ui/scripts/ui-custom/login.js
@@ -123,6 +123,7 @@
         // SAML Login action
         $login.find('input[type=samlsubmit]').click(function() {
             args.samlLoginAction({
+                data: {'idpid': $login.find('#saml-idps').find(':selected').val()}
             });
         });
 
@@ -130,7 +131,7 @@
         $login.find("#saml-login").hide();
         $.ajax({
             type: "GET",
-            url: createURL("getSPMetadata"),
+            url: createURL("listIdps"),
             dataType: "json",
             async: false,
             success: function(data, textStatus, xhr) {
@@ -139,6 +140,16 @@
                 } else {
                     $login.find('#saml-login').hide();
                 }
+                var idpList = data.listidpsresponse.idp.sort(function (a, b) {
+                    return a.orgName.localeCompare(b.orgName);
+                });
+                $.each(idpList, function(index, idp) {
+                    $login.find('#saml-idps')
+                        .append($('<option>', {
+                            value: idp.id,
+                            text: idp.orgName
+                        }));
+                });
             },
             error: function(xhr) {
                 $login.find('#saml-login').hide();


Mime
View raw message