Enable authentication and authorization in Azure Container Apps with Google
This article shows you how to configure Azure Container Apps to use Google as an authentication provider.
To complete the following procedure, you must have a Google account that has a verified email address. To create a new Google account, go to accounts.google.com.
Follow the Google documentation at Google Sign-In for server-side apps to create a client ID and client secret. There's no need to make any code changes. Just use the following information:
https://<hostname>.azurecontainerapps.iowith the name of your app in <hostname>.
- For Authorized Redirect URI, use
Copy the App ID and the App secret values.
The App secret is an important security credential. Do not share this secret with anyone or distribute it within a client application.
Sign in to the Azure portal and navigate to your app.
Select Authentication in the menu on the left. Select Add identity provider.
Select Google in the identity provider dropdown. Paste in the App ID and App Secret values that you obtained previously.
The secret will be stored as a secret in your container app.
If you're configuring the first identity provider for this application, you'll also be prompted with a Container Apps authentication settings section. Otherwise, you may move on to the next step.
These options determine how your application responds to unauthenticated requests. The default selections redirect all requests to sign in with this new provider. You can change customize this behavior now or adjust these settings later from the main Authentication screen by choosing Edit next to Authentication settings. To learn more about these options, see Authentication flow.
For adding scope: You can define what permissions your application has in the provider's registration portal. The app can request scopes at login time which leverage these permissions.
You're now ready to use Google for authentication in your app. The provider will be listed on the Authentication screen. From there, you can edit or delete this provider configuration.
Working with authenticated users
Use the following guides for details on working with authenticated users.