getsentry / getsentry/sentry

Progressive permissions for OAuth with GitHub

Open
#61,423 3 comments 0 reactions 0 assignees View on GitHub
Feature GitHub Product Area: Settings - Auth
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
22h 21m
Merged PRs (30d)
586

Description

### Problem Statement

As a user of GitHub SSO with Sentry for work, I do not want to be forced to share access to my personal repositories with Sentry.

Stated differently: I should be able to use GitHub SSO with Sentry by only sharing public profile information.

### Solution Brainstorm

I contacted Sentry support about this and they told me to open an issue here. It appears that the team at Sentry believe that this is not possible with the GitHub API, but I am quite confident that it is possible as I have implemented similar in my own applications.

I understand that Sentry _needs_ `repo` scope from GitHub OAuth in the case that individual users are connecting their personal projects. However, in the case of using GitHub OAuth as SSO for Sentry at work, it should be possible for sentry to only request public profile data and perhaps membership information from a specific organization.

I suggest an implementation that would allow a Sentry user to connect their GitHub account as a profile with no access only. To do this, the OAuth flow on Sentry's side would need to be modified to request `read:org` as documented here: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes

Additionally, the user will have to approve organization access for the relevant organizations with "OAuth app access restrictions" enabled per: https://docs.github.com/en/organizations/managing-oauth-access-to-your-organizations-data/about-oauth-app-access-restrictions

This would allow employees of companies using GitHub SSO with Sentry to access Sentry without providing access to additional account data that is sensitive.

Those Sentry users who also want to provide additional access to their private personal data on GitHub could easily be upgraded to a higher scope level with a simple request.

### Product Area

Settings - Teams

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.