diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 7a059ad38cd..823fc85ea28 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -9654,7 +9654,7 @@ div.container div.panel div#details-tab-addloadBalancer.detail-group div.loadBal
}
/*** View switcher (drop-down)*/
-.project-switcher {
+.project-switcher, .domain-switcher {
float: left;
width: 223px;
padding: 9px 17px 0 19px;
@@ -9665,7 +9665,7 @@ div.container div.panel div#details-tab-addloadBalancer.detail-group div.loadBal
border-radius: 4px;
}
-.project-switcher label {
+.project-switcher label, .domain-switcher label {
top: 29px;
color: #FFFFFF;
font-size: 13px;
@@ -9674,7 +9674,7 @@ div.container div.panel div#details-tab-addloadBalancer.detail-group div.loadBal
margin-top: 5px;
}
-.project-switcher select {
+.project-switcher select, .domain-switcher select {
width: 70%;
float: left;
margin-top: 0px;
diff --git a/ui/index.jsp b/ui/index.jsp
index b7c9b08899c..dcdbbff7849 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -1797,6 +1797,7 @@
+
diff --git a/ui/scripts/ui-custom/saml.js b/ui/scripts/ui-custom/saml.js
new file mode 100644
index 00000000000..391e7f885c7
--- /dev/null
+++ b/ui/scripts/ui-custom/saml.js
@@ -0,0 +1,96 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+(function($, cloudStack) {
+ $(window).bind('cloudStack.ready', function() {
+ var showSamlDomainSwitcher = false;
+ if (g_idpList) {
+ showSamlDomainSwitcher = true;
+ }
+ if (!showSamlDomainSwitcher) {
+ return;
+ }
+
+ var $label = $('