Add READ_ORG to the list of GitHub default OAuth 2.0 scopes The default GitHub scope without the extra permission to read someone's organisation membership is pretty much useless. GitHub without the read:org does not even give access to public information such as public organisations and teams, which are exposed over the internet for even anonymous users to browse. Change-Id: Ib0a70efd66c2de8a7fcb6e1399daa54761a6492c
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java index 1844251..6d04697 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
@@ -48,7 +48,7 @@ private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(GitHubLogin.class); private static final List<Scope> DEFAULT_SCOPES = Arrays.asList( - Scope.PUBLIC_REPO, Scope.USER_EMAIL); + Scope.PUBLIC_REPO, Scope.USER_EMAIL, Scope.READ_ORG); private static final long SCOPE_COOKIE_NEVER_EXPIRES = DAYS .toSeconds(50 * 365);