Reputation: 11006
I have browsed various questions here on SO, but none seem to have helped.
So, I have the following setup on Azure. I had a simple flask app running, which I could access using https://xyz.azurewebsites.net
.
I was trying to look at the example here (https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-python-web-app?tabs=linux). I can reproduce this example fine when I have the local server running and specifying the redirect uri as http://localhost:5000/getAToken
.
Now, I want to use my deployed app, so I changed the redirect URI in the azure portal under authentication as
https://xyz.azurewebsites.net/getAToken
However, this always returns the redirect URI mismatch error.
On the flask side, I have kept the configuration as:
REDIRECT_PATH = "/getAToken"
Although I tried putting the full absolute URL as well and it did not work.
Upvotes: 1
Views: 978
Reputation: 7392
I have followed the same document which you have provided and able to access the Application even after deploying to Azure App Service
.
In app_config.py
, change the authority_template
to
authority_template = "https://{b2c_tenant}.b2clogin.com/{b2c_tenant}.onmicrosoft.com/{signupsignin_user_flow}"
OR
tenant
and user_flow
value directly.authority_template = "https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{user_flow}"
Local Output:
Deploy the Application to Azure App Service:
VSCode
to it.OR If you face any issues in pushing the code to Git.
Your Repository:
And change the values in app_config.py
accordingly (from your local VSCode
).
In Azure Portal
=> Create a new App Service
with Run time Stack Python
.
Deployment center
=> Deploy the code using GitHub Actions
.https://YourDeployedAppName.azurewebsites.net/getAToken
Here my deployed app name is myadb2c
.So, update the Redirect URI as below.
https://myadb2c.azurewebsites.net/getAToken
***Workflow in GitHub Repository: ***
Deployed Application Output:
Upvotes: 1