guide

Sign in with Google for Your Authava Chatbot

Your website visitors can sign in with the Google account they already have, and your Authava chatbot knows who they are. Each visitor clicks one button. The bot then knows their name and email, so it can greet them, skip asking for details it already has, and answer for that person.

To try it with your own Google account, open the Sign in with Google demo. It also has the full setup steps and page code.

When Is It Useful?

Use it when your bot does things for one person. For example, it can save a repair request under the visitor's name, and list that visitor's own requests when they come back.

When the bot calls your own systems, the call says which signed-in visitor it's for. Your system uses that to find that person's own records.

How Do I Set It Up?

You set it up once, for the whole site. Your visitors don't set anything up.

  1. Create a Google Client ID. On Google Cloud's Clients page, click Create client and choose Web application.
  2. Add your site. Under Authorized JavaScript origins, add your site's address, such as https://www.example.com, with no path or trailing slash. Click Create, then copy the Client ID.
  3. Send the Client ID to your Authava team. They connect it to your bot and turn on sign-in.
  4. Add the page code. It shows Google's button and hands the sign-in to the chat. Copy it from the demo page.

Google's guide, Get your Google API client ID, walks through steps 1 and 2 in more detail.

How Does the Page Code Work?

When Google signs a visitor in, it gives your page a token: a short signed note that says who the visitor is. Your page passes it to the chat:

chat.setAuthToken(response.credential);
await chat.refetchSettings();

Here chat is the bot's controls on your page. See Integrating with your page.

To sign the visitor out, call google.accounts.id.disableAutoSelect(), then chat.setAuthToken(''). The chat then starts fresh, which helps keep the last conversation private on a shared computer.

What Do Visitors See?

  • One button. They click Sign in with Google and pick their account. They don't type a password on your site.
  • No second sign-in. The chat uses the sign-in from your page.
  • Returning visitors are usually signed in again automatically, without a click, when the page code uses Google's auto_select option, as the demo does.
  • Guests can still chat. Visitors who don't sign in chat as before. If you'd like every chat to need sign-in, ask your Authava team.

Can I Let Only My Own Staff Sign In?

Yes. Your Authava team can limit sign-in to your company's Google Workspace domain, such as example.com. The bot then recognizes only accounts in that domain, and treats anyone else as a guest.

Without a limit, anyone with a Google account can sign in.

Frequently Asked Questions

What does Authava receive from Google?

The visitor's name, email address and Google account ID. Authava checks the sign-in with Google first: Google's signature, your Client ID, that it hasn't expired, and that Google verified the email. Authava doesn't receive the visitor's password, and the sign-in gives no access to their Gmail, Drive or other Google data.

How long does a sign-in last?

Google's sign-in lasts about an hour. Returning visitors are usually signed in again automatically when they come back.

Can visitors chat without signing in?

Yes. They chat as guests, as before. Your Authava team can set the bot to require sign-in for every chat instead.

Does this change bots that don't use it?

No. A bot without Sign in with Google works as it did before.