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

HTTP to HTTPS redirect seems to break OAuth2 #80

Open
paul121 opened this issue Mar 30, 2020 · 2 comments
Open

HTTP to HTTPS redirect seems to break OAuth2 #80

paul121 opened this issue Mar 30, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@paul121
Copy link
Member

paul121 commented Mar 30, 2020

We've chosen to force the aggregator to connect to farmOS servers via https when running in production. This works by defaulting to the https scheme unless the AGGREGATOR_OAUTH_INSECURE_TRANSPORT flag is set in which case the default is http. (Note that a farm url can still supply a scheme, which is then used instead of the defaults)

The problem we found is that making an http request to authorize or refresh tokens (any request to the /oauth2/token endpoint on the farmOS server, basically) on a server that redirects to https fails. The server responds with an error message like: (invalid_request) The request method must be POST when requesting an access token. Need to investigate that more, but it seems like it might be related to the redirect.

For now, this is not a concern as our first use case for the aggregator requires farmOS servers to use https. We will need to revisit this in the future to allow both https and http in production

@paul121 paul121 added the bug Something isn't working label Mar 30, 2020
@loc-ng
Copy link

loc-ng commented Feb 17, 2022

we are facing a similar issue when authorizing the Farmos from a Farmos-Aggregator.

The FarmOS showed "Page not found" with URL of oauth2/authorize?response_type=code....
Is there any update on this issue?

@mstenta
Copy link
Member

mstenta commented Feb 17, 2022

@loc-ng That sounds like a different issue - can you please open a new one instead?

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

No branches or pull requests

3 participants