flask-dance icon indicating copy to clipboard operation
flask-dance copied to clipboard

Flask dance with azure app service & front door

Open fbomb111 opened this issue 3 months ago • 0 comments

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!

fbomb111 avatar Apr 11 '24 12:04 fbomb111