Skip to content

CLOUDSTACK-8622: Reinstate working sessions in browser - #574

Closed
yadvr wants to merge 1 commit into
4.5from
CLOUDSTACK-8622
Closed

yadvr wants to merge 1 commit into
4.5from
CLOUDSTACK-8622

Conversation

@yadvr

@yadvr yadvr commented Jul 9, 2015

Copy link
Copy Markdown
Member
  • 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 it is not removed for that specific case
  • UI: on logout, all cookies are removed (though this won't remove httponly ones)
  • Secure jsessionid cookie is set to be HttpOnly and Secure
  • SAML login should also set HttpOnly cookie before redirecting to UI
  • SAML: ListIdps API is made a readonly API that won't destroy an existing session

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

@asfbot

asfbot commented Jul 9, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #28 SUCCESS
This pull request looks good

@yadvr

yadvr commented Jul 9, 2015

Copy link
Copy Markdown
Member Author

I reviewed #308 and found that it needs more fixes, since that PR is slightly old now, worked on this. This aims to have a good trade off between security and re-enabling session across tabs: the greatest benefit is that refreshing the UI won't log you out.

Please review. cc @DaanHoogland @rsafonseca @wilderrodrigues @abhinandanprateek @jlk

@yadvr

yadvr commented Jul 9, 2015

Copy link
Copy Markdown
Member Author

(note: single patch ensures we capture the single aim with this fix and also easy to port to other branches, 4.5/master etc.)

@asfbot

asfbot commented Jul 9, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #723 SUCCESS
This pull request looks good

- 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>
@asfgit
asfgit force-pushed the CLOUDSTACK-8622 branch from 88f63d5 to 69d2fd8 Compare July 9, 2015 22:10
@asfbot

asfbot commented Jul 9, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #30 SUCCESS
This pull request looks good

@asfbot

asfbot commented Jul 9, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #725 SUCCESS
This pull request looks good

@abhinandanprateek

Copy link
Copy Markdown
Contributor

This was much needed. The code looks good to me.

@wilderrodrigues

Copy link
Copy Markdown
Contributor

"page refreshes, opening
multiple tabs,"

Nice!

I also liked the String.format() calls. I should use it more as well. For some stuff still using MessageFormat from the text package. But String.format() makes life easier and code more readable.

LGTM 👍

@DaanHoogland

Copy link
Copy Markdown
Contributor

LGTM be sure to add 2 'this closes #' lines. one for this and one for 308

@asfgit asfgit closed this in 42940a8 Jul 10, 2015
asfgit pushed a commit that referenced this pull request Jul 10, 2015
- 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
asfgit pushed a commit that referenced this pull request Jul 10, 2015
- 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

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

Conflicts:
	server/src/com/cloud/api/ApiServlet.java
	utils/src/com/cloud/utils/HttpUtils.java
@yadvr

yadvr commented Jul 10, 2015

Copy link
Copy Markdown
Member Author

Thanks for the reviews, merged on 4.5/master now.

@hubot
hubot deleted the CLOUDSTACK-8622 branch July 13, 2015 11:44
yadvr added a commit to shapeblue/cloudstack that referenced this pull request Jul 14, 2015
- 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 apache#574
This closes apache#308

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

Conflicts:
	server/src/com/cloud/api/ApiServlet.java
	utils/src/com/cloud/utils/HttpUtils.java
maneesha-p pushed a commit to maneesha-p/cloudstack that referenced this pull request Jul 31, 2015
- 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 apache#574
This closes apache#308
yadvr pushed a commit that referenced this pull request Jan 20, 2021
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants