docs: clarify GitLab API URI must be base URL without /api/v4#237
Open
shubhangamgarg wants to merge 1 commit into
Open
docs: clarify GitLab API URI must be base URL without /api/v4#237shubhangamgarg wants to merge 1 commit into
shubhangamgarg wants to merge 1 commit into
Conversation
The 'GitLab API URI' field expects a base server URL only. The plugin passes this value to the GitLabApi constructor in GitLabAuthenticationToken.java, which internally appends /api/v4 via the gitlab4j library. Entering the full API path (e.g. https://gitlab.example.com/api/v4) results in a doubled path (/api/v4/api/v4/user), causing a silent 404 error and an infinite OAuth redirect loop during login. Changes: - Add help/realm/gitlab-api-uri-help.html with explicit warning - Update docs/README.md to remove stale api/v3 reference and clarify correct vs incorrect input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "GitLab API URI" field label implies users should enter the full
API path (e.g. https://gitlab.example.com/api/v4). However, the plugin
passes this value directly to the GitLabApi constructor (GitLabAuthenticationToken.java:101),
which internally appends /api/v4 via the gitlab4j library.
This results in a doubled path (/api/v4/api/v4/user) → silent 404
→ infinite OAuth redirect loop. The error is hard to diagnose because
Jenkins shows no clear message, just a redirect loop.
Changes
docs/README.md: replace staleapi/v3example with explicitcorrect/incorrect examples and warning
src/main/webapp/help/realm/gitlab-api-uri-help.html: new helptooltip file (the field had no ? help text previously)
Tested
Verified on self-hosted GitLab CE with gitlab-oauth-plugin 1.30
and gitlab4j-api 6.3.0.
Testing done
Submitter checklist