Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The redirect URI included is not valid" on GitLab #7100

Closed
peterstory opened this issue Feb 13, 2024 · 6 comments
Closed

"The redirect URI included is not valid" on GitLab #7100

peterstory opened this issue Feb 13, 2024 · 6 comments
Labels
area: extensions/backends/gitlab type: bug code to address defects in shipped code

Comments

@peterstory
Copy link

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.

@peterstory peterstory added the type: bug code to address defects in shipped code label Feb 13, 2024
@Hariraghav
Copy link

The same error occurred for me when I used the Authorization Code with PKCE Flow. Then, I switched to using the Implicit Grant Flow.

@peterstory
Copy link
Author

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.

@blackb1rd
Copy link
Contributor

suspected same issue at #7093

@Hariraghav
Copy link

Hariraghav commented Feb 16, 2024

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.

@demshy
Copy link
Member

demshy commented Feb 21, 2024

Thank you @blackb1rd, the fix was released as 3.1.2.
@peterstory please see if your issue was fixed

@peterstory
Copy link
Author

Success! After updating to 3.1.2, I was able to authenticate to GitLab using pkce auth. Thank you for the quick resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/backends/gitlab type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

5 participants