Configure your App Service or Azure Functions app to use Google login
This topic shows you how to configure Azure App Service or Azure Functions to use Google as an authentication provider.
To complete the procedure in this topic, 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://<app-name>.azurewebsites.netwith the name of your app in <app-name>.
- 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.
In the Azure portal, go to your App Service app.
Select Settings > Authentication / Authorization, and make sure that App Service Authentication is On.
Select Google, then paste in the App ID and App Secret values that you obtained previously. Enable any scopes needed by your application.
App Service provides authentication but doesn't restrict authorized access to your site content and APIs. For more information, see Authorize or deny users.
(Optional) To restrict site access only to users authenticated by Google, set Action to take when request is not authenticated to Google. When you set this functionality, your app requires that all requests be authenticated. It also redirects all unauthenticated requests to Google for authentication.
Restricting access in this way applies to all calls to your app, which might not be desirable for apps that have a publicly available home page, as in many single-page applications. For such applications, Allow anonymous requests (no action) might be preferred so that the app manually starts authentication itself. For more information, see Authentication flow.
You are now ready to use Google for authentication in your app.
- App Service Authentication / Authorization overview.
- Advanced usage of authentication and authorization in Azure App Service
- Tutorial: Authenticate and authorize users end-to-end in Azure App Service
- Add authentication to your Mobile App: iOS, Android, Windows Universal, Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Cordova.