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

Universal GitHub Enterprise Server support? #39

Open
geofft opened this issue Oct 3, 2023 · 4 comments
Open

Universal GitHub Enterprise Server support? #39

geofft opened this issue Oct 3, 2023 · 4 comments
Labels

Comments

@geofft
Copy link

geofft commented Oct 3, 2023

Hi! I saw the notes/slides from your talk that got posted to the Git mailing list. If I understand them correctly, you're trying to get GitLab (and have successfully gotten Gitea) to recognize your client ID out of the box so that authentication to any GitLab server, not just gitlab.com, works.

I think the same issue applies to GitHub, in that there's a self-hosted GitHub Enterprise Server product. For example, the gh command supports talking to an enterprise server, not just github.com.

Have you chatted with GitHub about doing the same thing? I think it'd be useful - my employer ended up writing something that's basically like your tool for our Enterprise Server instance. (Though at this point we've customized it significantly and we now support transparent single sign-on without even bringing up a browser, which is its own much more complicated story.... but I think it'd be useful for other people! :) )

@hickford
Copy link
Owner

hickford commented Oct 4, 2023

Hi. I haven't yet, but I'd like to. I don't have access to any GitHub Enterprise Server for testing.

@hickford
Copy link
Owner

hickford commented Oct 4, 2023

  1. Does Git Credential Manager OAuth work without setup? It looks like GCM uses universal OAuth client credentials for all instances.

GCM uses different redirect URIs for GitHub Enterprise Server and GitHub so the client registrations must be independent in some way

  1. How does GitHub Enterprise Server respond to unauthenticated requests? Is the www-authenticate: Basic realm="GitHub" header the same as GitHub?

The same according to git-ecosystem/git-credential-manager#1246

@hickford
Copy link
Owner

hickford commented Oct 4, 2023

As a workaround, you can configure git-credential-oauth to impersonate Git Credential Manager using its public credentials:

# impersonate Git Credential Manager 
git config --global credential.https://github.example.com.oauthClientId 0120e057bd645470c1ed
git config --global credential.https://github.example.com.oauthClientSecret 18867509d956965542b521a529a79bb883344c90
git config --global credential.https://github.example.com.oauthRedirectURL http://localhost/

This requires git-credential-oauth 0.11 together with Git 2.41 or later.

@kerhac
Copy link

kerhac commented Oct 25, 2023

I just tested the workaround and can confirm it works.

  • GitHub Enterprise Server 3.8.3
  • git version 2.42.0
  • git-credential-oauth current main ea99a5e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants