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.

[Feature Request] make redirect_uri work until gitlab fix their issue.

See original GitHub issue

What problem does the feature solve?

gitlab oauth should work from any static page. Not just from the document root.

Problem: Currently gitlab oauth workflow is not working when user from a static website try to comment on a particular page other than the root page. This issue was already reported here. But it was closed citing this gitlab issue

Proposed solution

The default redirect_uri= value sent by Vssue to GitLab is window.location.href without [prefix], Instead of sending window.location.href, why not send redirect_uri=window.locaiton.origin with state property containing base64 encoded object with original state and local redirect_uri where this internal redirect_uri should contain window.location.href, so when oath completes, Vssue can check for redirect_uri in state and again redirect to the original url which initiated the oauth request.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cybermolochcommented, Jul 14, 2020

As @meteorlxy mentioned in another issue (https://github.com/meteorlxy/vssue/issues/76), this needs to be applied to all APIs. Passing the current URL as a Base64 string could work for all of them instead of passing the current URL encoded.

I think because we are passing the state into Base64, we may not need to encode it first. (Base64 will accept any single byte characters and any non ASCII characters should already be encoded by the browser as it would be an invalid URL otherwise?) As I previously mentioned, I am using this in an SPA with vue-router in hash mode (Vuelog). Although having vue-router work in history mode might help somewhat, many static hosting will not allow changing parameters for doing a catch-all redirect. (See https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations for more info.) Even so, we need to make sure Vssue works in both modes.

Another consideration is that the window.location.origin without the full state loaded may not include the Vssue component so if Vssue is responsible for handling the state and going back to the original page, it may not work as intended. In that case, a new route for should be added and used as the routing for Vssue OAuth requests. An alternative would be to have a Vssue stub component to handle this on another page even if it doesn’t allow comments but that seems messier.

0reactions
mohan43ucommented, Nov 15, 2020

@cybermoloch I did some fix to my patch to make sure hash string is not omitted after redirection. Kindly check if it works for you now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

oauth - deal with redirect_uri (#3374) · Issues - GitLab
Make sure these are completed before closing the issue, with a link to the relevant commit. Feature assurance; Documentation; Added to features.
Read more >
An error has occurred: The redirect URI included is not valid ...
Turned out that I had a wrong URL listed "mattermost.example.com" and in gitlab.rb I had "mm.example.com". Changed it to the value in gitlab.rb ......
Read more >
Index · Pages · Administration · Help · GitLab
Run the Pages daemon in the same server as GitLab, listening on the same IP but on different ports. In that case, you...
Read more >
OpenID Connect Configuration - Dependency-Track
gitlab.com currently does not set the required CORS headers, see GitLab issue #209259. For on-premise installations, this could be fixed by setting the...
Read more >
bypass OIDC logout confirmation (#2607) · Issues - OW2 Gitlab
Summary Like bypass consent feature, it could be interresting to have a ... to check the redirect uri until the logout operation 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