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

config: add options for OAuth functionality #7635

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

coanghel
Copy link

What is the purpose of this change?

For Docker environments, need to bind to 0.0.0.0 instead of localhost
For rclone served by reverse proxy, should be able to override redirrect

Was the change discussed in an issue or in the forum before?

Fixes #7634

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

For Docker environments, need to bind to 0.0.0.0 instead of localhost
For rclone served by reverse proxy, should be able to override redirrect

Fixes rclone#7634
@ncw
Copy link
Member

ncw commented Feb 18, 2024

Can you drop the formatting changes from docs.md please? It's very difficult see what you changed!

Also why does this have a separate config for redirect URL? Will that be different to the bind address?

Thank you for taking a look at this.

@coanghel
Copy link
Author

Done, sorry about that I didn't even notice Prettier decided to hijack the markdown formatting. I added .vscode to the gitignore, I hope that's okay.

The bind address can (and necessarily will in Docker) be different in Docker deployments. For example, the bind address to listen to incoming OAuth callbacks in a Docker container will be 0.0.0.0:PORT however the redirect address that must be sent to the OAuth provider (e.g. Microsoft or Google or whatever) needs to be the public address that eventually is routed to that bind address.

Unfortunately, I noticed that various different remotes use different redirect URLs from the main oauthutil.go. Rather than update every single remote type to standardize what is used from oauthutil.go, it made more sense to allow the user to do a global override since the redirect URL will be managed by a reverse proxy anyway.

@coanghel
Copy link
Author

coanghel commented Mar 5, 2024

Hi @ncw , just following up if everything looks right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth 2.0 Compatibility for Docker / Headless Runtimes
2 participants