105 Commits

Author SHA1 Message Date
Rohit Yadav
107595a6a5 CLOUDSTACK-8457: SAML auth plugin improvements for production usage
* Move config options to SAML plugin
  This moves all configuration options from Config.java to SAML auth manager. This
  allows us to use the config framework.
* Make SAML2UserAuthenticator validate SAML token in httprequest
* Make logout API use ConfigKeys defined in saml auth manager
* Before doing SAML auth, cleanup local states and cookies
* Fix configurations in 4.5.1 to 4.5.2 upgrade path
* Fail if idp has no sso URL defined
* Add a default set of SAML SP cert for testing purposes
  Now to enable and use saml, one needs to do a deploydb-saml after doing a deploydb
* UI remembers login selections, IDP server

- CLOUDSTACK-8458:
    * On UI show dropdown list of discovered IdPs
    * Support SAML Federation, where there may be more than one IdP
        - New datastructure to hold metadata of SP or IdP
        - Recursive processing of IdP metadata
        - Fix login/logout APIs to get new interface and metadata data structure
        - Add org/contact information to metadata
        - Add new API: listIdps that returns list of all discovered IdPs
        - Refactor and cleanup code and tests

- CLOUDSTACK-8459:
    * Add HTTP-POST binding to SP metadata
    * Authn requests must use either HTTP POST/Artifact binding

- CLOUDSTACK-8461:
    * Use unspecified x509 cert as a fallback encryption/signing key
      In case a IDP's metadata does not clearly say if their certificates need to be
      used as signing or encryption and we don't find that, fallback to use the
      unspecified key itself.

- CLOUDSTACK-8462:
    * SAML Auth plugin should not do authorization
      This removes logic to create user if they don't exist. This strictly now
      assumes that users have been already created/imported/authorized by admins.
      As per SAML v2.0 spec section 4.1.2, the SP provider should create authn requests using
      either HTTP POST or HTTP Artifact binding to transfer the message through a
      user agent (browser in our case). The use of HTTP Redirect was one of the reasons
      why this plugin failed to work for some IdP servers that enforce this.
    * Add new User Source
      By reusing the source field, we can find if a user has been SAML enabled or not.
      The limitation is that, once say a user is imported by LDAP and then SAML
      enabled - they won't be able to use LDAP for authentication
    * UI should allow users to pass in domain they want to log into, though it is
      optional and needed only when a user has accounts across domains with same
      username and authorized IDP server
    * SAML users need to be authorized before they can authenticate
        - New column entity to track saml entity id for a user
        - Reusing source column to check if user is saml enabled or not
        - Add new source types, saml2 and saml2disabled
        - New table saml_token to solve the issue of multiple users across domains and
          to enforce security by tracking authn token and checking the samlresponse for
          the tokens
        - Implement API: authorizeSamlSso to enable/disable saml authentication for a
          user
        - Stubs to implement saml token flushing/expiry

- CLOUDSTACK-8463:
    * Use username attribute specified in global setting
      Use username attribute defined by admin from a global setting
      In case of encrypted assertion/attributes:
      - Decrypt them
      - Check signature if provided to check authenticity of message using IdP's
        public key and SP's private key
      - Loop through attributes to find the username

- CLOUDSTACK-8538:
    * Add new global config for SAML request sig algorithm

- CLOUDSTACK-8539:
    * Add metadata refresh timer task and token expiring
        - Fix domain path and save it to saml_tokens
        - Expire hour old saml tokens
        - Refresh metadata based on timer task
        - Fix unit tests

This closes #489

(cherry picked from commit 20ce346f3acb794b08a51841bab2188d426bf7dc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	client/WEB-INF/classes/resources/messages_hu.properties
	plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixCheckHealthCommandWrapper.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	ui/scripts/ui-custom/login.js
2015-06-29 12:31:51 +02:00
Rohit Yadav
6c71d3bae1 ui: if session cookie exists, use it to set global session holder and invalidate it
The 19e3c0168e744a76b5e1dc24a5eafa776d342404 commit breaks SAML login and any
login where redirection is used.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit b79f13ccb54c6afc48c42bc94c61621dc6cac32d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-13 15:02:27 +05:30
Jessica Wang
a308f37232 CS-18149: UI - no longer store sessionKey in cookie. After
... this change, opening the 2nd browser window (of the same
domain) will show login screen (i.e. user has to enter
credentials again) and will cause the 1st browser window
session timeout.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 19e3c0168e744a76b5e1dc24a5eafa776d342404)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-13 15:02:27 +05:30
Rohit Yadav
552f2ae60c CLOUDSTACK-8191: SAML users should have their own accounts
(cherry picked from commit 876c78fe1ba6abe132131b3449b21fd09f2c14e1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-02 19:58:10 +05:30
Wei Zhou
af2f21894c CLOUDSTACK-7983: Create Disk/Service Offering for Domain Admin 2014-12-01 13:03:37 +01:00
Brian Federle
68745ae9b1 CLOUDSTACK-7645: UI: Fix method for extending dictionary
Instead of mapping both dictionary JSP files to separate objects, extend
dictionary2's object onto single 'dictionary' object.

-- The previous approach was causing issues on certain dialogs, which were not
opening due to possible missing labels.
2014-11-12 09:57:42 -08:00
Mihaela Stoica
901c243ed1 CLOUDSTACK-7645: [UI] Fixed incorrect label issues caused the dictionary split
In some cases the UI does not display the correct text, displaying 'label.xyz' instead of the localized string.
This appears to be due to the dictionary split: entries in dictionary2.jsp are not found because the dictionary has not been extended with dictionary2 as expected.

In this fix:
- Instead of extending the dictionary, we leave it as it is and change the localization function to look in the dictionary first and, if the item is not found there, then look in dictionary2.
- This way we are not depending on the extent() function to be called at the 'right' time; In turn, the localization function will be aware of both dictionaries.
- In the future, when we add another dictionary, we will have to modify this function only.
2014-11-11 11:22:35 -08:00
Jessica Wang
8d3a9b760d CLOUDSTACK-7809: UI > remove usage of g_mySession which is unnecessary. 2014-10-29 11:17:18 -07:00
Jessica Wang
bde0c3cfc1 CLOUDSTACK-7809: UI > remove unnecessary cookie 'timezoneoffset'. 2014-10-28 16:37:46 -07:00
Jessica Wang
4d06eef3b5 CLOUDSTACK-7809: UI > remove unnecessary cookie 'networktype'. 2014-10-28 15:30:57 -07:00
Jessica Wang
6e8a08308b CLOUDSTACK-7809: UI > remove unnecessary cookie 'capabilities', 'supportELB', 'kvmsnapshotenabled', 'regionsecondaryenabled', 'userpublictemplateenabled', 'userProjectsEnabled'. 2014-10-28 15:03:44 -07:00
Jessica Wang
53d5e8af18 CLOUDSTACK-7668: UI > When UI is loaded the first time, sometimes a blank screen instead of a login screen shows. Only after clicking Refresh button(i.e. loaded again) will the login screen show. 2014-10-02 14:43:22 -07:00
vetrivelc
6a11d099cf Fix Externalization of hard-coded label strings
-Split 'dictionary.jsp' into two files -> 'dictionary.jsp' and
'dictionary2.jsp' -- this is due to JSP file constraints as the
localization object is getting quite long

-Per change above, 'dictionary' object is now split into an additonal
'dictionary2' object, which is merged with the main dict object on page
load

-All new dictionary mappings should be added to 'dictionary2' now.

Signed-off-by: Brian Federle <brian.federle@citrix.com>
2014-09-17 13:59:13 -07:00
Rohit Yadav
e6ec51e12a ui: refactor and use a unified unboxing helping method in cloudStack.js
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-28 19:45:22 +02:00
Rohit Yadav
a364054db6 Minor fixes
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-28 19:45:21 +02:00
Rohit Yadav
9b1a6dac4a ui: Unbox extra quotes from sessionKey cookie value
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-28 19:45:21 +02:00
Mihaela Stoica
f212aa57c3 CLOUDSTACK-7293: UI: Fixed localization issues on the login page
- Reverted the validator.messages to the original values (jquery.validator.js).
- Added a function to localize validator.messages which is called before login.

Signed-off-by: Brian Federle <brian.federle@citrix.com>
2014-08-15 10:51:28 -07:00
Jessica Wang
3acebf230c CLOUDSTACK-6852: UI - modules - remove variable drModuleIncluded. 2014-06-13 15:21:16 -07:00
Jessica Wang
a8a853e322 CLOUDSTACK-6852: UI - modules - add global variable drModuleIncluded. 2014-06-06 13:29:53 -07:00
Brian Federle
4dad376f98 UI: Make sure notification box is removed on session expire 2014-02-27 13:26:32 -08:00
Brian Federle
63c22a1508 Session expire: show overlay on dialog to prevent clicking in UI 2014-02-13 15:06:09 -08:00
Jessica Wang
1db19c3d52 CLOUDSTACK-4428: KVMsnapshoteanbled property in listCapabilities API response has been renamed. Here is corresponding UI change. 2013-12-09 15:21:47 -08:00
Jessica Wang
fd47059436 CLOUDSTACK-3950: UI > remove global variable havingS3, havingSwift who are no longer in use. 2013-08-20 16:04:40 -07:00
Jessica Wang
4bee74464f CLOUDSTACK-3950: UI > template/ISO page > registerTemplate/registerISO action > zone dropdown > include only one option "All Zones" when secondary storage is region-wide. 2013-08-20 14:25:13 -07:00
Jessica Wang
aa223e5786 CLOUDSTACK-4308: UI > volume page > if hypervisor is KVM, show/hide takeSnapshot, recurringSnapshot action upon KVMsnapshotenabled property returned by listCapabilities API. 2013-08-15 10:27:44 -07:00
Ian Duffy
ad69bc8da3 Format JS 2013-07-18 12:34:20 -04:00
Brian Federle
37ba08a8ea UI: Fix localization fn override
If localization function is specified in another plugin, do not use the
default
2013-07-10 11:18:27 -07:00
Brian Federle
7ce0bd69a8 UI plugin framework: Fix load order
Fixes potential issue where plugins could load after cloudStack UI is initialized,
preventing their functionality from showing up.

Now, the main UI is only loaded after all plugins have loaded; this is via
'cloudStack.pluginReady' event.
2013-07-10 11:18:27 -07:00
Jessica Wang
40678a27da CLOUDSTACK UI - remove obsolete code (window.name is no longer used). 2013-07-09 15:25:40 -07:00
Brian Federle
bd1ddee557 UI: Localize app name and 'about' window 2013-07-02 11:59:20 -07:00
Alex Huang
3047929367 Merged 2013-05-10 16:21:43 -07:00
Jessica Wang
e0fa8e1e93 CLOUDSTACK-2351: object store - UI - cloudstack.js - replace listS3s, listSwiftsAPI with new API listImageStores. 2013-05-07 12:04:07 -07:00
Brian Federle
7b011e7ef4 Merge branch 'master' into ui-vm-affinity
Conflicts:
	client/WEB-INF/classes/resources/messages.properties
	ui/scripts/cloudStack.js
	ui/scripts/instanceWizard.js
2013-04-22 13:45:29 -07:00
Jessica Wang
8b8a2f218c CLOUDSTACK-1910: cloudstack UI - make Regions menu visible to regular-user/domain-admin. 2013-04-16 13:15:31 -07:00
Brian Federle
5d235f690d Add new 'affinity' UI section for managing affinity groups 2013-04-15 14:56:44 -07:00
Jessica Wang
5f8a278196 CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - make loginCmdText local. 2013-04-11 13:39:04 -07:00
Jessica Wang
7de2b4b30a CLOUDSTACK-1957: cloudstack UI - fix a JS error "'logout' is undefined" which sometimes shows on login screen. 2013-04-07 11:40:46 -07:00
Jessica Wang
ebcdef55b0 CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - shorten value of g_loginCmdText 2013-04-07 09:00:17 -07:00
Jessica Wang
b1ef74737a CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - when switching region, set location without parameters. 2013-04-07 00:14:18 -07:00
Brian Federle
abbc3b3bc6 UI: Add _reloadUI helper function
Adds a console helper function, which will reinitialize the UI
with the current window.cloudStack object. This is used primarily
for debugging, so that any changes to the UI structure can be viewed
without reloading the browser.
2013-03-22 10:29:48 -07:00
Brian Federle
0fbf1b91b0 Regions single-sign-on: Hide login form on redirect
If login URL is passed to management server on load, show loading
screen in place of login form.
2013-03-21 15:27:44 -07:00
Jessica Wang
918a7c7481 CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - implement region switching action triggered by region dropdown on top menu. 2013-03-20 11:58:57 -07:00
Brian Federle
142a5a8fba Implement region list view 2013-02-26 13:09:32 -08:00
Brian Federle
dfaffcebad Merge branch 'master' into ui-plugins
Conflicts:
	ui/index.jsp
2013-02-13 14:03:53 -08:00
Jessica Wang
06a733a89f CLOUDSTACK-618: cloudstack UI - API request throttling - for async job action, make frequency of calling queryAsyncJobResult API based on listCapabilities response. 2013-02-12 16:00:48 -08:00
Brian Federle
b67e49d8ce Conditionally load plugin section
If no UI plugins are loaded via plugins.js, then hide 'plugins'
section, to avoid confusion due to a blank plugin page.
2013-02-11 11:45:34 -08:00
Brian Federle
eae7d43c2c Merge branch 'master' into ui-plugins 2012-12-19 14:00:28 -08:00
Brian Federle
9b1c74e7f5 Add plugins section 2012-12-19 14:00:20 -08:00
John Kinsella
5658fc4249 CLOUDSTACK-646: Cleaning up Citrix/eula/CloudPlatform references
Tried to remove any references to license agreements, EULA, Citrix,
or CloudPlatform. Tested through devcloud, didn't see decreased UI
functionality.
2012-12-16 20:39:03 -08:00
Edison Su
b70c1a5a84 Backs NFS-based secondary storage with an S3-compatible object store. Periodically, a reaper thread synchronizes templates and ISOs stored on a NFS secondary storage mount with a configured S3 object store. It also pushes snapshots to the object store when they are created and downloads them in other zones on-demand. In addition to permitting the use of commodity or IaaS storage solutions for static assets, it provides a means of automatically synchronizing template and ISO assets across multiple zones. 2012-12-13 23:18:37 -08:00