blob: c5018cffc89287ab5d349ced156b052a4005c8ec [file] [log] [blame]
abdelseaudieefb7492018-03-16 06:24:48 +00001Enabling Single-Signon
2======================
3
4This tutorial explains the Single-Signon of ONAP Portal, and how to enable it in our sample application.
5
6When a user logs in using the ONAP Portal Login, a cookie is created to record the logged-in session,
7and it includes the username and other parameters.
8
9In our tutorial app so far we used "http://app-host:port/epsdk-app-os/login.htm" to login into the application.
10
11This is called the external login, which is used a backdoor for developers to test the applications
12in a local environment, without having the entire Portal.
13
14Now, when the application is ready and onboarded on to the Portal, we can now use
15"http://app_host:port/epsdk-app-os/welcome.htm" as the application onboarding URL in ONAP Portal.
16
17Onboarding steps can be found here
18https://wiki.onap.org/display/DW/Application+Onboarding#ApplicationOnboarding-addapp.
19
20The welcome.htm page code will try to read the session cookie from the browser to detect if there is
21a user that's already logged-in into the ONAP Portal.
22
23If a cookie is found, then this means a user is already logged-in to the ONAP Portal and
24the application welcome.htm page will display showing the application frontend in a tab inside ONAP Portal.
25
26However, if a cookie is not found, the code will look for the redirect URL listed in the
27WEB-INFO/classes/portal.properties file.
28
29Assuming the ecomp_redirect_url = http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm
30for Amsterdam release, then, the user will be redirected to the ONAP Portal login page to log in.
31
32If the user login succeeds, the Portal login page will redirect the user back to the Application
33welcome page.
34
35This should enable the application to use the Portal’s Single Signon.
36
37Note that the ONAP Portal and its on-boarded application must be on the same domain
38(e.g. *.simpledemo.onap.org) to take advantage of the Single Signon.
39
40Otherwise, if the application is hosted in a different domain, its code will not be able to read ONAP
41Portal session cookies.
42
43Due to security reasons the ONAP Portal restricts to one domain (defined in the properties) across
44the applications on-boarded to it.
45
46However, if the application is not interested in single signon feature, then the new application can
47be always be on-boarded as a “Hyperlink only application” which will be opened into a new browser
48rather than the internal Portal’s tab.
Manoop Talasila322bf262018-04-06 10:52:41 -040049
50Changing the cookie domain
51--------------------------
52
53Changing the single-sign on cookie domain in portal requires both development and config activity:
54
55
56development - change this file and rebuild the front-end
57^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
59::
60
61 ./ecomp-portal-FE-os/client/configurations/integ.json:102: "cookieDomain": "onap.org"
62
63
64configuration - change this deployment entry
65^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67::
68
69 ./deliveries/properties_simpledemo/ONAPPORTAL/system.properties:104:ext_central_access_user_domain = @csp.onap.org
70
71
72Apps that are built on the EP-SDK have an entry in a config file that must be changed
73^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
75::
76
77 ./deliveries/properties_simpledemo/ONAPPORTALSDK/system.properties:67:cookie_domain = onap.org