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.

Invalid redirect URL error when authenticating to private gitlab

See original GitHub issue

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug I’m getting an ‘Invalid redirect URL’ error when attempting to authenticate against private gitlab instance.

To Reproduce Steps to reproduce the behavior:

  1. Attempt to authorize via a private GitLab instance
  2. See error on GitLab page

Expected behavior Authentication should work

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 14.6.11

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome, Firefox
  • Version: current

Additional context Looking at the URL sent to GitLab, the redirect_uri parameter is ‘https://diagrams.{mydomain}/gitlab’. In the last version in which this worked, the value was ‘https://diagrams.{mydomain}/gitlab.html’ (which is also the configured redirect URL in GitLab).

Changing the redirect URL in GitLab to ‘…/gitlab’ instead of ‘…/gitlab.html’ fixes the error on the GitLab side, but authentication still fails because Diagrams doesn’t respond to the ‘…/gitlab’ URL, it wants the ‘.html’ extension.

Downgrading to v14.6.2 fixes this, so there was a regression in constructing the redirect_uri since then.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
trocstercommented, Jul 9, 2021

had to change the “http-nio-7070” port because of a conflict when running locally (puma ?)

Catalina is started via a “run” (not “start”) so logs all are going to stdout[0], albeit at the default verbosity level.

Also tried to follow the comment/instructions and it also fails using version 14.8.5 after the gitlab “Authorize drawio to use your account?”

Using:

docker run -it --rm -e DRAWIO_GITLAB_ID='*' -e GITLAB_CLIENT_SECRET='*' -e GITLAB_AUTH_URL=https://gitlab.domain.com/oauth/token --name="draw" -p 7070:7070 drawio

and using the call back / redirect url with out the .html, to give a blank page with status code 400. The favicon loads after it.

The last entires in the log are: 08-Jul-2021 23:40:52.138 INFO [http-nio-7070-exec-4] com.mxgraph.online.AbsAuthServlet.doGet AUTH-SERVLET: [172.17.0.1] Found cookie state (* -> *)

and the last uRL is http://localhost:7070/gitlab?code=*&state=cld=*&domain=localhost&token=*

[0] https://stackoverflow.com/a/50730492/2568021

1reaction
plinsscommented, Jun 14, 2021

I’m using the jgraph/drawio docker image behind a simple Nginx reverse proxy for TLS termination. I’m mounting a local PreConfig.js and PostConfig.js (Method 3 in the docs) and am setting window.GITLAB_URL and window.GITLAB_ID in PreConfig.js. We have a local GitLab instance. This setup works with version 14.6.6 and before of the Docker image.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gitlab pages with access control shows a not valid redirect url
From a custom server gitlab, when enabling the access control for Gitlab Pages, on every other permission than 'Everyone' in Settings -> General ......
Read more >
GitLab Redirect URI for project import invalid - Migrations
These are my callback URLs (with domain censored). Using https:// didn't work as well. The same error occurs when trying to sign up...
Read more >
Gitlab Applications Redirect URI not a valid URI (#231603)
Hi : On gitlab.com I created an OAuth application, ... to gitlab, I have an error message The redirect URI included is not...
Read more >
Create redirects for GitLab Pages
In GitLab Pages, you can configure rules to forward one URL to another using Netlify style HTTP redirects. Not all special options offered...
Read more >
Bitbucket import repoitory failure - invalid redirect_uri - GitLab
Once user is redirected to Bitbucket for authentication, error occurs. ... Link issues together to show that they're related or that one is ......
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