microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.24k stars 1.21k forks source link

Azure Deployment /api/auth/error Page #187

Closed vtxjholter closed 1 year ago

vtxjholter commented 1 year ago

Build is successful however when selecting either login option I get dropped to an /api/auth/error page that only shows "Error" and the name of my app service. I have updated NEXTAUTH_URL to both my app service URL as well as the Custom URL configured for it.

My deployment and login with Microsoft 365 work fine when running locally and using NEXTAUTH_URL=https://localhost:3000

Am I missing something in the docs that needs to be changed to deploy to azure, or where do I start looking for logs?

giuliohome commented 1 year ago

Not only must the Build job be successful, but also the Deploy job. You need to set the environment variables on Azure App Services, as explained here. Additionally, please remember to change the redirect URI etc. in the configuration of the OAuth2 Provider (e.g., Github) as well

image

image

vtxjholter commented 1 year ago

I was missing the Auth Variables in the webapp. I had gone through Identity during local deployment then skimmed it during Azure deployment and missed the callout that it was needed in the webapp variables as well.

Thank you.