Skip to content

Commit 1dfde3c

Browse files
authored
Merge pull request #719 from ldennington/gitlab-add-read-repo-scope
Add `read_repository` GitLab OAuth Scope
2 parents f2b20a4 + 47df201 commit 1dfde3c

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

docs/faq.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,17 @@ After revoking access, any tokens created by GCM will be invalidated and can no
150150
### I used the install from source script to install GCM on my Linux distribution. Now how can I uninstall GCM and its dependencies?
151151

152152
Please see full instructions [here](./linux-fromsrc-uninstall.md).
153+
154+
### How do I revoke access for a GitLab OAuth application?
155+
156+
There are some scenarios (e.g. updated scopes) for which you will need to manually revoke and re-authorize access for a GitLab OAuth application. You can do so by:
157+
158+
1. Navigating to [the **Applications** page within your **User Settings**](https://gitlab.com/-/profile/applications).
159+
2. Scrolling to **Authorized applications**.
160+
3. Clicking the **Revoke** button next to the name of the application for which you would like to revoke access (Git Credential Manager is used here for demonstration purposes).
161+
162+
![Button to revoke GitLab OAuth Application access](./img/gitlab-oauthapp-revoke.png)
163+
4. Waiting for a notification stating **The application was revoked access**.
164+
165+
![Notifaction of successful revocation](./img/gitlab-oauthapp-revoked.png)
166+
5. Re-authorizing the application with the new scope (GCM should automatically initiate this flow for you next time access is requested).

docs/gitlab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Git Credential Manager supports [gitlab.com](https://gitlab.com) out the box.
66

77
To use on another instance, eg. `https://gitlab.example.com` requires setup and configuration:
88

9-
1. [Create an OAuth application](https://docs.gitlab.com/ee/integration/oauth_provider.html). This can be at the user, group or instance level. Specify a name and use a redirect URI of `http://127.0.0.1/`. _Unselect_ the 'Confidential' option, and ensure the 'Expire access tokens' option is selected. Set the scope to 'write_repository'.
9+
1. [Create an OAuth application](https://docs.gitlab.com/ee/integration/oauth_provider.html). This can be at the user, group or instance level. Specify a name and use a redirect URI of `http://127.0.0.1/`. _Unselect_ the 'Confidential' option, and ensure the 'Expire access tokens' option is selected. Set the 'write_repository' and 'read_repository' scopes.
1010
1. Copy the application ID and configure `git config --global credential.https://gitlab.example.com.GitLabDevClientId <APPLICATION_ID>`
1111
1. Copy the application secret and configure `git config --global credential.https://gitlab.example.com.GitLabDevClientSecret <APPLICATION_SECRET>`
1212
1. Configure authentication modes to include 'browser' `git config --global credential.https://gitlab.example.com.gitLabAuthModes browser`

docs/img/gitlab-oauthapp-revoke.png

139 KB
Loading

docs/img/gitlab-oauthapp-revoked.png

44.5 KB
Loading

src/shared/GitLab/GitLabHostProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class GitLabHostProvider : HostProvider
1313
private static readonly string[] GitLabOAuthScopes =
1414
{
1515
"write_repository",
16+
"read_repository"
1617
};
1718

1819
private readonly IGitLabAuthentication _gitLabAuth;

0 commit comments

Comments
 (0)