Skip to content

Cannot link to user identity with OAuth prefix #99

@ernestoalejo

Description

@ernestoalejo

We use Gerrit configured with GitHub OAuth. When updating this plugin to the latest version this error appears every time the users log in and a Forbidden error is returned.

Error in the logs:

[2018-01-03 09:53:01,472] [HTTP-79] ERROR com.google.gerrit.httpd.auth.oauth.OAuthSession : OAuth accounts disagree over user identity:
Claimed ID: 1000000 is 961XXX
Delgate ID: 1000259 is github-oauth:961XXX

I saw the commit 879bbae and configured it using:

git config -f "$GERRIT_SITE/etc/gerrit.config" plugin.gerrit-oauth-provider-github-oauth.fix-legacy-user-id true

The file gerrit.config has the following settings related to the plugin:

[plugin "gerrit-oauth-provider-github-oauth"]
	client-id = XXX
	client-secret = XXX
	fix-legacy-user-id = true
[plugin "gerrit-oauth-provider-bitbucket-oauth"]
	fix-legacy-user-id = false
[plugin "gerrit-oauth-provider-cas-oauth"]
	fix-legacy-user-id = false

The cache is not stale, we re-index everything automatically when Gerrit is restarted with the following commands:

java -jar $GERRIT_SITE/bin/gerrit.war init --batch -d $GERRIT_SITE
java -jar $GERRIT_SITE/bin/gerrit.war reindex -d $GERRIT_SITE

This issue is similar to #91, but I'm already in the latest stable version of Gerrit.

Does anyone know why the plugin is not adding the prefix when comparing it to migrate old accounts?

Versions:
Gerrit: 2.14.6, downloaded from https://www.gerritcodereview.com/download/gerrit-2.14.6.war
Gerrit OAuth provider: 2.14.6, downloaded from https://github.com/davido/gerrit-oauth-provider/releases/download/v2.14.6/gerrit-oauth-provider.jar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions