Skip to content

Support any OAuth server with custom config #1047

Closed
@hickford

Description

@hickford

To add OAuth support for a new forge requires around a thousand lines of code which has to be reviewed (example PRs: GitLab, Gitea, Gitee). Each new assembly adds megabytes to git-credential-manager binary size. Is any code necessary? All are similar OAuth implementations with only trivial differences in OAuth parameters.

Ideally you could use GCM with any generic OAuth forge with only simple config to specify the OAuth parameters, no code change necessary.

https://github.com/hickford/git-credential-oauth has this feature. Here's an example config for gitee.com:

[credential "https://gitee.com"]
	oauthClientId = b5da229f85d94f5d728c43e429c69527fe2dcc387d4ffcb677b91c93983adaa3
	oauthClientSecret = a9f88c722f66e54184204efa0f49b960f2666947e0b14bd0d73a8c9c1c33c340
	oauthScopes = projects gists
	oauthAuthURL = /oauth/authorize
	oauthTokenURL = /oauth/token
	# workaround server confused by random ports
	oauthRedirectURL = http://127.0.0.1:53119

Metadata

Metadata

Assignees

Labels

auth:oauthSpecific to OAuth2 authenticationhost:genericSpecific to the generic (basic/WIA) host provider

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions