Website.sign_in_using_google#

Website.sign_in_using_google(client_id, client_secret, after_auth_url, additional_scopes=None, custom_username=None, custom_host=None, **other_params)#

Signs in a user using Google (Experimental).

Make sure to create a Google app first. Also, add the following as an authorized redirect URI to your Google app: https://<your-domain>/toui-google-sign-in

Parameters:
  • client_id (str) – The client ID of the Google app.

  • client_secret (str) – The client secret of the Google app.

  • after_auth_url (str) – The URL to redirect to after completing authentication. This is not the same as the redirect uri of the Google app, so you do not need to register it as an authorized redirect URI in your Google app.

  • additional_scopes (list, default=None (optional)) – By default, the user allows the app to only access non-sensitive information such as the user’s name and email. If you want to access more information, you can pass a list of scopes. For more information, see Google’s documentation.

  • custom_username (str, default=None (optional)) – If you want to use a custom username instead of the user’s email, you can pass it here.

  • custom_host (str, default=None (optional)) – Only use this option if you need to change the scheme and host of the redirect uri. For example, if you want to use http://127.0.0.1:5000 instead of http://localhost:5000, you can pass http://127.0.0.1:5000 here.

  • other_params (kwargs (optional)) –

    Keyword arguments that can be passed as parameters to authorization url.For more information, see Google’s documentation.