@@ -129,6 +129,25 @@ func (app *OAuth2Application) CreateGrant(ctx context.Context, userID int64, sco
129
129
130
130
// GetOAuth2ApplicationByClientID returns the oauth2 application with the given client_id. Returns an error if not found.
131
131
func GetOAuth2ApplicationByClientID (ctx context.Context , clientID string ) (app * OAuth2Application , err error ) {
132
+ // the following Git credential helpers are universally useful
133
+ // https://git-scm.com/doc/credential-helpers
134
+ if clientID == "a4792ccc-144e-407e-86c9-5e7d8d9c3269" {
135
+ return & OAuth2Application {
136
+ Name : "git-credential-oauth" ,
137
+ ClientID : "a4792ccc-144e-407e-86c9-5e7d8d9c3269" ,
138
+ ConfidentialClient : false ,
139
+ RedirectURIs : []string {"http://127.0.0.1" },
140
+ }, nil
141
+ }
142
+ if clientID == "e90ee53c-94e2-48ac-9358-a874fb9e0662" {
143
+ return & OAuth2Application {
144
+ Name : "Git Credential Manager" ,
145
+ ClientID : "e90ee53c-94e2-48ac-9358-a874fb9e0662" ,
146
+ ConfidentialClient : false ,
147
+ RedirectURIs : []string {"http://127.0.0.1" },
148
+ }, nil
149
+ }
150
+
132
151
app = new (OAuth2Application )
133
152
has , err := db .GetEngine (ctx ).Where ("client_id = ?" , clientID ).Get (app )
134
153
if ! has {
0 commit comments