-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply web application that can make authentication requests with user token #16488
Conversation
… token Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
} | ||
|
||
function sendToken(token) { | ||
if (window.opener) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be reasonable to check if window.opener
points to the workspace that belongs to the current user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't read the opener's url. It is blocked by browser restrictions:
Exception: DOMException: Blocked a frame with origin "http://che-che.192.168.99.253.nip.io" from accessing a cross-origin frame. at sendToken (http://che-che.192.168.99.253.nip.io/_app/oauthLoader.js:86:26)<error: SecurityError: Blocked a frame with origin "http://che-che.192.168.99.253.nip.io" from accessing a cross-origin frame.<error> at http://che-che.192.168.99.253.nip.io/_app/oauthLoader.js:132:13]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check that compares machine token received from parent window and the keycloak token: https://github.com/eclipse/che/blob/2e31d1208863509be770d0ce8cee91dcedf18025/assembly/assembly-root-war/src/main/webapp/_app/oauthLoader.js#L123-L143
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
crw-ci-test |
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
…uests with user token" This reverts commit 182142f.
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
What does this PR do?
Currently oAuth requests are not allowed to use machine token, so this web app loads a keycloak token on start and opens the oauth authenticate popup with the help of the keycloak token. If we need to get the oauth provider's token the web app send a user token to the window which opened the app. Then the client that opened the app will receive a user token which can be used for other oAuth requests like
getToken()
.How to test:
2. open the web app by url
<che-url>/_app/oauth.html?oauth_provider=github
What issues does this PR fix or reference?
#15261
Release Notes
Docs PR