decap-cms
decap-cms copied to clipboard
"The redirect URI included is not valid" on GitLab
Describe the bug I'm trying to configure Decap for GitLab-hosted GitLab Pages. However, when I try to authenticate I get the error: "The redirect URI included is not valid." from GitLab.
To Reproduce My repo is https://gitlab.com/trinityworc/trinityworc.gitlab.io which is hosted at https://trinityworc.gitlab.io
Decap is available at: https://trinityworc.gitlab.io/admin/
I'm using Client-Side PKCE Authorization.
Expected behavior The auth flow should complete successfully.
Applicable Versions:
- Decap CMS version: decap-cms@^3.0.0
- Git provider: GitLab
- OS: macOS
- Browser version: Safari 17.3
CMS configuration My config.yml contains:
backend:
name: gitlab
repo: trinityworc/trinityworc.gitlab.io
auth_type: pkce
app_id: 4cc4af5fcdddf53c7d6f6ff0d170153a999635dda84e2dbec80658b69a4e3618
media_folder: "images/uploads"
public_folder: "/images/uploads"
collections:
- name: "news"
label: "News"
folder: "docs/_posts"
create: true
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "post"}
- {label: "Title", name: "title", widget: "string"}
Additional context I tried authorizing both user-owned and group-owned applications on GitLab, but no success either way.
The same error occurred for me when I used the Authorization Code with PKCE Flow. Then, I switched to using the Implicit Grant Flow.
I just tried with the implicit grant, and I got a new error: "The authorization server does not support this response type."
So perhaps GitLab removed support for implicit grant.
suspected same issue at https://github.com/decaporg/decap-cms/issues/7093
I just tried with the implicit grant, and I got a new error: "The authorization server does not support this response type."
So perhaps GitLab removed support for implicit grant.
Mine is a self hosted gitlab instance and implicit grant works fine. In my case decap cms removed / at the end of the redirect uri while making the request that's what causing the issue.
Thank you @blackb1rd, the fix was released as 3.1.2. @peterstory please see if your issue was fixed
Success! After updating to 3.1.2, I was able to authenticate to GitLab using pkce auth. Thank you for the quick resolution!