Your users can log in to their Google accounts in your app. It’s easy to add Google login to the Users Service - see Users:Authentication Choices to see how.
If you want to use the Anvil Google API to present a login form just for Google accounts, this section tells you how. You may wish to do it this way if you don’t want to store your users email addresses in your app’s Users table.
To allow your users to log into your app with Google, call
import anvil.google.auth email_addr = anvil.google.auth.login() print("User logged in as %s" % email_addr)
If the login succeeds,
anvil.google.auth.login() will return the user’s email address.
If the login fails, or the user cancels,
anvil.google.auth.login() will raise an exception.
To find out who is currently logged in, call
anvil.google.auth.get_user_email(). If nobody is logged
in, this returns
import anvil.google.auth # This can run on the server: email_addr = anvil.google.auth.get_user_email() print("%s is now logged in" % email_addr)