question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin does not work in master branch with oauth.type=OAUTH

See original GitHub issue

It appears that choosing this auth type means that Gerrit now expects a plugin to include an OAuthLoginProvider to be used for logging in. Since gerrit-oauth-provider does not include this, the plugin no longer works.

I was still able to get the plugin to work by using the OPENID_SSO auth type, but the plugin docs say not to do that so I’m concerned that it is not a good workaround.

edit: looking into it more, I guess the issue is that on the master branch of gerrit the logic in GitOverHttpModule.java is different: it sets authFilter = ProjectOAuthFilter.class whenever the auth type is OAUTH, whereas in the release branch it requires basic auth to be enabled as well. This was done in commit 84d830b5b350fdbae7c075473bceea9ec619b3c9

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
davidocommented, Nov 6, 2017

Ah right, the configuration is invalid. We should document it more prominently.

See this change and particularly the default: [1] auth.gitBasicAuthPolicy is configured as:

By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`
and `OAUTH` when link:#auth.type[`auth.type`] is `OAUTH`.
Otherwise, the default value is `HTTP`.

So, that in case of auth.type == OAUTH, auth.gitBasicAuthPolicy is initialized to OAUTH. However the gerrit-provider-plugin currently doesn’t implement that policy, so that it cannot work.

Solution: overload that policy with HTTP:

[auth]
        type = OAUTH
        gitBasicAuthPolicy = HTTP

and this should fix it.

[1] https://gerrit-review.googlesource.com/#/c/gerrit/+/99079/5/Documentation/config-gerrit.txt@495

1reaction
davidocommented, Nov 8, 2017

We should document it more prominently.

I added documentation to https://github.com/davido/gerrit-oauth-provider/wiki/FAQ.

Read more comments on GitHub >

github_iconTop Results From Across the Web

oauth 2.0 - How to pull from official/master using github api for ...
The merge will just merge code from the new branch to existing branches, it has nothing to do with pulling latest code from...
Read more >
Introduction to OAuth - Snowflake Documentation
Authorization Server¶. This server displays an interface to a user to approve or deny client access to their data. The server issues an...
Read more >
GitHub autentication with Gerrit - Google Groups
I've read to do this I need a few plugins to get the OAuth setup, ... the master branch points to Gerrit API...
Read more >
Use the Jenkins OAuth plug-in to securely pull from GitHub
Starting from the very basics -- how to download the application WAR file and pull code from GitHub -- this Jenkins tutorial will...
Read more >
What is the OAuth 2.0 Authorization Code Grant Type?
This ensures that the request to get the access token is made only from the application, and not from a potential attacker that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found