140 Commits

Author SHA1 Message Date
Rohit Yadav
42940a8828 CLOUDSTACK-8622: Reinstate working sessions in browser
- Login is based on sessionkey HttpOnly Cookie
- ApiServlet does login verification using sessionKey from both the request cookies
  and the API parameters. In both cases, if either or both are passed they should
  match the sessionKey stored in the current session of the HttpRequest
- UI: it no longer needs to read or set sessionkey cookie
- UI: it no longer needs to return g_sessionKey value in the API requests, though
  to support a sso mechanism g_sessionKey is still passed in the API is not null
- Secure jsessionid cookie is set to be HttpOnly and Secure
- SAML login should also set HttpOnly cookie before redirecting to UI
- SAML: listIdps & getSPMetadata APIs are readonly now, won't log out a logged in user

Performed tests (login, saml login if applicable, page refreshes, opening
multiple tabs, logout) with following combinations:
- SAML disabled, normal auth as admin, domain-admin and user
- SAML enabled, normal auth as admin, domain-admin and user; and saml sso as
  admin, domain-admin and user

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

This closes #574
This closes #308
2015-07-10 17:25:07 +05:30
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
Remi Bergsma
a7f8059fd3 CLOUDSTACK-6543 Sort domain lists in UI
As recently discussed on the dev list:
This sorts the domain lists based on their path.
Especially handy when having a lot of domains,
like in a public cloud.
2015-04-12 23:21:43 -05:00
Wei Zhou
ce2b2a1fc7 Deploy vm to specified host through Infrastructure -> Hosts -> <Select one> -> View Instances -> Add Instance 2014-12-01 14:47:06 +01:00
Devdeep Singh
cfe5a6fcbf While adding secondary storage / is not added to secondary storage cifs url.
This causes it to fail if that path doesn't begin with '/'. It works fine
while adding primary storage. Added a check to add '/' in begining if needed.
2014-11-14 11:20:25 +05:30
Jessica Wang
5d094e5cab CLOUDSTACK-7896: UI > network > Add Guest Network > when zone dropdown is empty, do not make API call to get physical networks. 2014-11-12 16:24:15 -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
Gabor Apati-Nagy
1033990e91 CLOUDSTACK-7765: Field Validations Missing for VPC IP Address Fields 2014-10-29 10:15:08 -07:00
Gabor Apati-Nagy
efb3287fdc CLOUDSTACK-7764: No IP Address Validations when Adding Networks Added validations for Add Network form on IPv4 Gateway, IPv4 Netmask, IPv4 Start IP, IPv4 End IP, IPv6 Gateway, IPv6 CIDR, IPv6 Start IP, IPv6 End IP fields. 2014-10-28 14:23:57 -07:00
Jessica Wang
0af0c041e9 CLOUDSTACK-5719: UI > Network > Add Guest Network > when Physical Network dropdown is changed, refresh Network Offering dropdown (because each physical network has its own tags which maps to different network offerings) 2014-10-09 13:15:03 -07:00
Jessica Wang
97768b2657 CLOUDSTACK-7668: UI > When UI is loaded the first time, sometimes a blank screen instead of a login screen shows > fix it by declaring the variables beforehand. 2014-10-02 17:07:57 -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
Brian Federle
c661289941 Fix session expire handling
If session has expired, hide entire UI (except for dialog) to prevent
clicking/seeing expired UI elements.
2014-09-17 13:31:39 -07:00
Jessica Wang
a39bf18bc7 CLOUDSTACK-7462: UI > Network > VPC > Router > Network ACL Lists > click an entry from list > Details tab > ACL List Rules tab > click Edit icon on any existing rule > fix the JavaScript error "args.jsonObj is undefined". 2014-09-10 15:35:53 -07:00
seif
fd6d083ad6 GUI changes to leverage a new control for storage tags 2014-08-17 17:18:51 -06:00
Mike Tutkowski
c344693e48 Inform the applicable storage plug-in's life cycle that capacity (bytes and/or IOPS) can be updated 2014-06-24 14:39:57 -06:00
Jessica Wang
3a3a3902b7 UI - modules - replace addExtraPropertiesIfDrModuleIncluded() with cloudStack.dr.sharedFunctions.addExtraProperties(). 2014-06-13 16:44:15 -07:00
Jessica Wang
3acebf230c CLOUDSTACK-6852: UI - modules - remove variable drModuleIncluded. 2014-06-13 15:21:16 -07:00
Jessica Wang
36ec16e4f5 CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView. 2014-06-06 15:18:46 -07:00
Jessica Wang
ea196a4ffc CLOUDSTACK-6858: UI - remove obsolete variable rootAccountId whose value is no longer 1. 2014-06-06 13:30:13 -07:00
Jessica Wang
a8a853e322 CLOUDSTACK-6852: UI - modules - add global variable drModuleIncluded. 2014-06-06 13:29:53 -07:00
Jessica Wang
f2a8082a43 CLOUDSTACK-6852: UI - add sharedFunction isModuleIncluded(). 2014-06-05 13:48:51 -07:00
Jessica Wang
021a604493 CLOUDSTACK-6789: UI > User page > fix a bug that a domain-admin was unable to delete other domain-admin in the same domain. 2014-05-27 15:45:53 -07:00
Sanjay Tripathi
35cd61c463 CLOUDSTACK-6649: CS is not giving the system-wide capacity for GPU reosurce. 2014-05-14 15:05:28 +05:30
Jessica Wang
f2d9d71844 CLOUDSTACK-6626: UI - fix a bug that g_userid was not declared. 2014-05-09 13:19:35 -07:00
Jessica Wang
8c8853e0e2 CLOUDSTACK-6296: UI > If an account's timezone is not set, show datetime field based on browser's timezoneoffset. 2014-03-27 14:12:19 -07:00
vetrivelc
182c31899b Externalized the hardcodedstrings from UI JAVASCRIPT files. 2014-03-05 14:11:51 -08:00
Niels de Vos
c02197ae86 Add Gluster to the list of protocols in the Management Server
Gluster can now be used for Primary Storage just like NFS. This change adds the
Gluster protocol to the Management Server:

    Infrastructure -> Primary Storage -> Add Primary Storage

And also add the option to create Primary Storage on Gluster when
following the 'Add Zone' wizard from:

    Infrastructure -> Zones -> Add Zone

Some screenshots and verification:
- http://blog.nixpanic.net/2013/12/using-gluster-as-primary-storage-in.html
2014-02-25 12:08:46 +01:00
Jessica Wang
c2fa24a24c CLOUDSTACK-6154: UI > compute offerings > memory field > check if value is undefined before converting it. 2014-02-21 13:23:19 -08:00
Devdeep Singh
306ffa0218 CLOUDSTACK-6053: While adding a primary or secondary of type smb the password wasn't
encoded. This cause createStoragePool or addImageStore command to fail if special
characters were present. Updated the code to pass user, password and domain as part
of details while adding primary or secondary. Also made changes on server side to
handle it.
2014-02-10 10:29:09 +05:30
Saksham Srivastava
06f8c1de75 CLOUDSTACK-5692: obscure passwords when using cifs as storage 2014-01-17 14:00:24 +05:30
Brian Federle
932758e2ef CLOUDSTACK-5551: Pass search 'name' field to listConfigurations UI
Passes search bar value (by 'name') for the settings in the following sections'
detail views:

-Account
-Primary storage
-Cluster
-Zone
2013-12-20 13:38:46 -08:00
Jessica Wang
a71915c034 CLOUDSTACK-5486: UI > tags > listXXXXXXX API now returns tags property. So, use tags property in embedded object returned by listXXXXXXX API to populate tags in detailView in all pages (instead of calling extra API listTags). 2013-12-17 14:16:55 -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
7d2961a0f3 CLOUDSTACK-999: hyper-V: UI > Infrastructure > Secondary Storages > listView, detailView > remove password from URL property. 2013-11-08 14:37:22 -08:00
Jessica Wang
f3d76dfa9e CLOUDSTACK-999: hyper-V: UI > Infrastructure > Secondary Storages > Add Secondary Storage > When provider is SMB, show SMB username/password/domain fields and send their value to url parameter of addImageStore API. 2013-11-08 13:02:10 -08:00
Jessica Wang
6916665623 CLOUDSTACK-4793: UI > Infrastructure > Virtual Routers > detail tab > add Requires Upgrade field to reflect new parameter requiresupgrade in API response. 2013-11-06 16:30:02 -08:00
Jessica Wang
c61d2eedf4 CLOUDSTACK-4908: UI > Infrastructure > Sockets > (1) calculate total number of CPU Sockets for all hypervisors.
(2) > view all > calculate CPU Sockets for each hypervisor.
2013-11-05 11:55:06 -08:00
Wei Zhou
5109498783 CLOUDSTACK-4830: allow create account and user by domain admin
(cherry picked from commit 0d12e3eb9d4fb0166fc553da7366f4da786daa14)
2013-10-31 11:36:54 +01:00
Jessica Wang
c3ddd3bf00 CLOUDSTACK-4649: UI > (1) Register Template dialog: add 'XenServer Tools Version 6.1+' checkbox.
(2) Template detailView: add 'XenServer Tools Version 6.1+' field.
(3) Instance detailView: add 'XenServer Tools Version 6.1+' field.
2013-10-23 12:50:42 -07:00
ynojima
a45ee749ac CLOUDSTACK-2328: Linux native VXLAN support on KVM hypervisor
Initial patch for VXLAN support.
Fully functional, hopefully, for GuestNetwork - AdvancedZone.

Patch Note:
 in cloudstack-server
- Add isolation method VXLAN
- Add VxlanGuestNetworkGuru as plugin for VXLAN isolation
- Modify NetworkServiceImpl to handle extended vNet range for VXLAN isolation
- Add VXLAN isolation option in zoneWizard UI

 in cloudstack-agent (kvm)
- Add modifyvxlan.sh script that handle bridge/vxlan interface manipulation script
-- Usage is exactly same to modifyvlan.sh
- BridgeVifDriver will call modifyvxlan.sh instead of modifyvlan.sh when VXLAN is used for isolation

Database changes:
- No change in database structure.
- VXLAN isolation uses same tables that VLAN uses to store vNet allocation status.

Known Issue and/or TODO:
- Some resource still says 'VLAN' in log even if VXLAN is used
- in UI, "Network - GuestNetworks" dosen't display VNI
-- VLAN ID field displays "N/A"
- Documentation!

Signed-off-by : Toshiaki Hatano <haeena@haeena.net>
2013-09-26 23:37:18 +09:00
Brian Federle
34c04a4546 UI code cleanup: Fix trailing commas in JS 2013-09-24 11:16:13 -07:00
Jessica Wang
fb7f5a0a46 CLOUDSTACK-4693: UI > Network > Add Guest Network dialog > physical network dropdown - populate only physical networks that have Guest traffic type. 2013-09-23 16:13:00 -07:00
Jessica Wang
723ef6e495 CLOUDSTACK-4702: UI > Network menu > Add Guest Network dialog > UI shouldn't pass null zoneid to listnetworkofferings API when zone dropdown is empty (i.e. when no advanced zone exists). 2013-09-18 16:45:01 -07:00
Jessica Wang
4f61396c61 CLOUDSTACK-4688: UI > (1) Notifications widget - pollTimer() - error handling - check if args is null before trying to access args.message property (2) sharedFunctions.js - pollAsyncJobResult() - error handling - pass message argument to args.error(). 2013-09-17 16:38:33 -07:00
Jessica Wang
59c6fb7ff2 CLOUDSTACK-4687: UI > infrastructure > zone > UCS > blades > add extra properties (Chassis, Blade ID) to ucsblade object returned by API which has only bladedn property. 2013-09-16 14:59:54 -07:00
Jessica Wang
44c9e80a4e CLOUDSTACK-4642: UI > get complete timezone list from Java class TimeZone 2013-09-10 16:20:31 -07:00
Ian Duffy
bdba0ddeed Bring up to date with master 2013-08-31 00:25:48 +01: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