Skip to content
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

Enhance OAuth integration when user doesn't want to grant permissions #22499

Closed
ehsavoie opened this issue Sep 8, 2023 · 9 comments
Closed
Assignees
Labels
area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts area/ux Issues related to User Experience Design kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/next status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach

Comments

@ehsavoie
Copy link

ehsavoie commented Sep 8, 2023

Is your enhancement related to a problem? Please describe

I'm always frustrated when I use a Che instance with GitHub OAuth enabled and I want to use a GitHub project to get the devfile I want to use (dong something quite similar to using a devfile registry).
It asks for GitHub permissions which I don't want to grant. If I press Cancel then it keeps on asking them each time I'm opening the workspace. In the end it finished with a 500 Internal Error json message.

Describe the solution you'd like

I'd like Che to accept that I don't want to use OAuth to connect to my GitHub account and I don't want to use Che to do Git operations (in my case it is mostly demo) and stop bugging me about those permissions after I refused to grant them.

Describe alternatives you've considered

I've created a fork of my project on BitBucket because currently it is not integrated with OAuth but that's not going to be something that might be valid in the future.

Additional context

No response

@ehsavoie ehsavoie added the kind/enhancement A feature request - must adhere to the feature request template. label Sep 8, 2023
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Sep 8, 2023
@ibuziuk
Copy link
Member

ibuziuk commented Sep 8, 2023

@ehsavoie thanks for reporting this enhancement, could you provide schematic UX mockup for OAuth opt out?
As an alternative you can configure PAT with from UD
Screenshot 2023-09-08 at 18 01 32

@ibuziuk ibuziuk added area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts area/ux Issues related to User Experience Design status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach labels Sep 8, 2023
@ibuziuk
Copy link
Member

ibuziuk commented Sep 8, 2023

@vinokurig thinking about this issue from impl perspective, I'm wondering if user opt out from OAuth / presses Cancel, instead of 500 create a cm e.g. oauth-opt-out in the user namespace that would be an indicator that OAuth flow should not be used for such a user. This would require no UI changes on UD / OAuth flow end

@ehsavoie
Copy link
Author

ehsavoie commented Sep 8, 2023

That would be my expectation. I don't know if the proper place would be the user or the workspace or the user/workspace combinaison

@l0rd l0rd added severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Sep 11, 2023
@ibuziuk
Copy link
Member

ibuziuk commented Sep 13, 2023

workspace-preferences-configmap might be a good place for oauth opt out field

@vinokurig
Copy link
Contributor

vinokurig commented Sep 15, 2023

If I press Cancel then it keeps on asking them each time I'm opening the workspace. In the end it finished with a 500 Internal Error json message.

This is a bug. If oauth page is rejected workspace start must proceed with asking to use a default devfile.
@ibuziuk

thinking about this issue from impl perspective, I'm wondering if user opt out from OAuth / presses Cancel, instead of 500 create a cm e.g. oauth-opt-out in the user namespace that would be an indicator that OAuth flow should not be used for such a user. This would require no UI changes on UD / OAuth flow end

Do you think this should be workspace scope or user scope? I mean if an oauth is rejected for particular workspace, should we automatically reject oauth for all other workspaces, or just for the current?

@ibuziuk
Copy link
Member

ibuziuk commented Sep 25, 2023

If oauth page is rejected workspace start must proceed with asking to use a default devfile.

well, but if the devfile is public we should use it and not fall back on default.
The problem described in this issue is that we require OAuth even for public repositories.

@vinokurig
Copy link
Contributor

well, but if the devfile is public we should use it and not fall back on default.

This should be fixed by eclipse-che/che-dashboard#932 and eclipse-che/che-server#568

The problem described in this issue is that we require OAuth even for public repositories.

This was added on purpose, we did not use to ask the authorisation for public repos at all. As far as I understood #22499 (comment), we should ask the authorisation (even for public repos) but keep the decision in a config-map.

@ibuziuk
Copy link
Member

ibuziuk commented Sep 25, 2023

we should ask the authorisation (even for public repos) but keep the decision in a config-map.

yes, we should initiate OAuth flow if configured for both public and private repos. If the user opt-out from OAuth, for public repos we should use the original devfile, for private we should use default similar to what was done for #22488

@ibuziuk
Copy link
Member

ibuziuk commented Sep 27, 2023

after a discussion with @l0rd it was decided that opt-out should be implemented on the provider level, not the workspace.
e.g. if user rejected OAuth once for particular provider, we should not ask again on subsequent workspaces startups

@svor svor closed this as completed Oct 18, 2023
@ibuziuk ibuziuk changed the title Enhance GitHub OAuth integration when user doesn't want to grant permissions Enhance OAuth integration when user doesn't want to grant permissions Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts area/ux Issues related to User Experience Design kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/next status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach
Projects
None yet
Development

No branches or pull requests

6 participants