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

[bug]: invalid oauth2 redirect_uri is generated #5853

Open
1 task done
drev74 opened this issue Oct 16, 2024 · 2 comments
Open
1 task done

[bug]: invalid oauth2 redirect_uri is generated #5853

drev74 opened this issue Oct 16, 2024 · 2 comments
Assignees
Labels
🐛bug Something isn't working

Comments

@drev74
Copy link

drev74 commented Oct 16, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I followed your docs to allow oauth2 login with Google

Login with Google generates the following request:

https://accounts.google.com/o/oauth2/v2/auth?client_id=<my-client>&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&redirect_uri=http%3A%2F%2Fplane.<invalid>.com%2Fauth%2Fgoogle%2Fcallback%2F&response_type=code&access_type=offline&prompt=consent&state=eb3db8cffda0467ba19f9dc1d2a13388

This is invalid redirect URI. It takes name from one of my workspaces, which is incorrect. This gives me an invalid subdomain like : plane.my-workspace.com instead of a subpath like plane.mysite.com/my-workspace

Corrent redirect_uri, which was autogenerated in Plane's God Mode is: https://plane.my-site.com/auth/google/callback

This results in OAUTH2 error: invalid redirect URI

Steps to reproduce

  1. Install Plane self hosted v.0.23.1
  2. Login God
  3. Click Authenticaiton
  4. Add Google auth
  5. Register Plane self hosted within Google APIs
  6. Enter Plane login screen and try Login with Google

Environment

Production

Browser

Google Chrome

Variant

Self-hosted

Version

0.23.1

@drev74 drev74 added the 🐛bug Something isn't working label Oct 16, 2024
@drev74
Copy link
Author

drev74 commented Oct 16, 2024

Please add oauth2 config Allowed JavaScript Origins and Allowed Redirect URIs to the plane helm chart 🙏

@rasyidly
Copy link

I'm using a layered proxy server, I don't know where the actual case is, but I'm trying to change this line

redirect_uri = f"""{"https" if request.is_secure() else "http"}://{request.get_host()}/auth/google/callback/"""
to

redirect_uri = f"""https://{request.get_host()}/auth/google/callback/"""

after changing the code, restart the Gunicorn with ps aux | grep gunicorn to find the PID of running service, then kill -HUP <pid>

IDK why it's working, because I'm not a py developer, also, I'm running on a self-hosted plane in my virtual Alpine Linux server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@vihar @rasyidly @drev74 @pushya22 and others