singingwolfboy / flask-dance

Doing the OAuth dance with style using Flask, requests, and oauthlib.
https://pypi.python.org/pypi/Flask-Dance/
MIT License
1k stars 157 forks source link

Flask dance with azure app service & front door #434

Open fbomb111 opened 5 months ago

fbomb111 commented 5 months ago

I have a flask app hosted at https://.azurewebsites.com. I've added the azure front door service which maps that url to mycustomdomain.com

I have a GitHub app and I tried to register the callback url as mycustomdomain.com. But then I get a uri mismatch. Looking at the error, it still thinks the callback should be .azurewebsites.com. I think it has something to do with the flask SERVER_NAME env variable, though I am not sure. If I try manually setting this variable I get issues with my app starting up.

I also tried overriding various parameters in the make_github_blueprint call, namely redirect_url and authorized_url, but these either cause errors or the urls are not found. I can retry those and post specific errors if it helps.

I did get this to finally work by setting the callback url in GitHub to .azurewebsites.com, but that doesn't seem ideal, as it's a specific server instead of a pool of servers.

Would like to know if you've encountered an issue like this before and if you have advice. Thanks for the help!