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

Fix https github oauth #1318

Merged
merged 1 commit into from
Apr 26, 2020
Merged

Fix https github oauth #1318

merged 1 commit into from
Apr 26, 2020

Conversation

flashlab
Copy link
Contributor

@OzzieIsaacs After spending several hours digging the github oauth problem #1307 , I finally makes it work with https domains.
First, the nginx configuration is needed to properly proxy the real domain and protocol to Flask, following this example.
And pyopenssl model is required: pip3 install -U pyopenssl.
Finally, import ProxyFix to make flask properly identity https protocols.
Feel free to test here https://calibre.redbux.cn
Some useful links:
https://stackoverflow.com/questions/54278247/flask-dance-and-error-redirect-uri-mismatch
https://flask-dance.readthedocs.io/en/latest/proxies.html
singingwolfboy/flask-dance#188

while using https domian and nginx as proxy, a `ProxyFix` is required.
@OzzieIsaacs OzzieIsaacs merged commit dea2600 into janeczku:master Apr 26, 2020
@OzzieIsaacs
Copy link
Collaborator

I had time to doublecheck the PR.
By just using the example given in the Calibre-Web wiki, replacing the /calibre with / and adding ssl to the nginx configuration it worked out of the box. Because werkzeug is talking about security concerns in using the proxyfix function and it shall only be used if it is necessary, I reverted your PR. I didn't have to install anything additional. I've tested it with an up to date Manjaro Linux with nginx 1.17 ("mainline"), the ssl Certificates where signed by Let's encrypt

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.

None yet

2 participants