FAQ content

Queues: Use Google OAuth for a queue's email sending method

In this article

LibAnswers supports using OAuth for Google as an option for email sending at the queue level.

To get started, you will need to work with your institution's IT administrator, specifically a Google Workspace Administrator, to set up the integration between Google and your LibAnswers system.

  • Step 1. An Admin user will need to create a Google Cloud project that is configured to give your LibAnswers site access to GMail's API. You will need to ask the appropriate IT staff member to do this—a member of your staff who is a Google Workspace Administrator.
    • Creating the project, and giving it the appropriate scope, is what allows you to send emails from a queue using your institution's SMTP server.
    • The LibAnswers app requires the /auth/gmail.send scope to be granted. No other permissions are needed by LibAnswers.
    • Even if you plan on activating Google OAuth email sending for multiple queues, only one project is required for your LibAnswers site—though you will have to specify the email address that will be used for sending for each queue.
  • Step 2. Once the project has been configured, a LibAnswers admin will need to enter the Client ID, Client Secret (both provided after the project has been created), and email address (that will be used for sending) in your LibAnswers queue's Email Sending Method settings.
    • Please note: it may take a few minutes after the app is registered before LibAnswers will be able to communicate with it.

Step 1. Set up a Google Cloud project account

Before you can activate the Google OAuth integration for your LibAnswers queue, you must first create the Google Cloud project and OAuth app (created within the project). You will need to work with your institution's IT administrator, specifically a Google Workspace Administrator, to do this step. Once the project/app has been created and configured, you will receive a unique Client ID and Client Secret, which LibAnswers needs in order for Google OAuth sync to work. This step only needs to be done once.

A. Obtaining the Redirect URL

The first part of this step is to obtain your queue's Redirect URL. A LibAnswers Admin will need to do this part.

  1. Log into LibAnswers and go to Admin > Queues > Edit Queue () icon for the queue > Email tab.
  2. In the Email Sending Method panel, select the Google OAuth: Authenticate via OAuth radio button.
  3. After selecting the Google OAuth option, you'll see the Redirect URL for the queue.
    • If you will be completing the Google Cloud project creation yourself, leave this page open in a separate browser tab. You'll need to copy and paste this URL during the registration process.
    • Otherwise, provide this URL to the person completing the project.
Redirect URL in the Email Sending Method panel

B. Creating the Google Cloud project

The person who will be creating the Google Cloud project/app for your organization will complete the following steps. This only needs to be set up once and should be done by a Google Workspace Administrator.

  1. Sign into the Google Cloud Platform using your Google account.
  2. In the navigation bar, click on the Projects button.
    1. If you have an existing project you want to use, select it from the list and click OPEN.
    2. Otherwise, click on New Project to create a new one.
Selecting or creating a new project
  1. If creating a new project, give it a name (for example, "LibAnswers Email Sending") and click the Create button. It may take a few seconds for Google to create the project—that's normal.
Creating a new project
  1. From the project's dashboard page, click on Library from the APIs & Services sidebar.
Clicking on the Library menu link
  1. The Library will present the available APIs you can use. Search for and click on the Gmail API.
The Gmail API search result
  1. On the Gmail API page, click on the Enable button at the top of the page.
Enabling the Gmail API
  1. Once enabled, you'll be redirected to the API/Service Details page for the Gmail API. From here click on the OAuth consent screen link in the sidebar.
navigating to the OAuth consent screen page
  1. On the OAuth consent screen page, select Internal for the app's User Type.
    • Note: The Internal option is only available for Google Workspace users and only makes the app available to users within your workspace. If you are not a Google Workspace user, then you can set the type to External.
  2. Click the Create button.
Screenshot highlighting the user type selection for OAuth consent
  1. On the next OAuth consent screen page, enter the App name (this could be the same name as your project).
  2. Set the User support email—entering an email address that users would contact about the app.
    • Note: While required for the app creation, this is not an email address that LibAnswers users will see or need to contact.
  3. In the Authorized Domains section, click the + Add Domain button.
  4. In the field that appears, enter the full domain of your LibAnswers site.
    • If you are not using a custom domain you would enter something like: mylibrary.libanswers.com.
    • If your LibAnswers site uses a custom domain, enter that here. Ex: ask.mylibrary.org.
  5. In the Developer Contact Information section, enter the email address that Google should have on file in the event that they need to contact you/your institution about changes to the project.
  6. Click the Save and Continue button.
editing the app registration details
  1. On the Scopes page, click the Add or Remove Scopes button to open the Update selected scopes panel.
  2. In the list of scopes, find and click the checkbox for the /auth/gmail.send scope.
    1. You can use the filters to narrow down the list of scopes displayed on the page.
  3. Click the Update button.
The scope selection panel
  1. Click the Save and Continue button.
    1. The selected scope will be added to the list of sensitive scopes for the app.
saving the scope selection
  1. On the Test users page, click the + Add Users button.
  2. On the Add Users panel, enter the email address that you will be using to send emails from for your LibAnswers queue.
    • If you plan on activating Google OAuth email sending for multiple queues, enter the email address to be used by each queue—you must use a separate email address for each queue.
  3. Click the Add button.
  4. Click the Save and Continue button.
entering the email address that will be used for sending as a test user
  1. On the Summary page, take a moment to review the details of the app to confirm that the settings match what is required and outlined in the steps above.
    1. If you need to make changes to the app, click the Edit link.
  2. Click on the Credentials link in the sidebar.
review the summary for the Oauth app
  1. On the Credentials page, click the + Create Credentials link.
  2. Select OAuth client ID from the dropdown menu.
selecting the OAUTH client ID option for new credentials
  1. On the Create OAuth client page, select Web Application from the Application Type dropdown.
  2. Give the OAuth credentials a Name. (This could be the same name as your project.)
  3. Click the Add URI button.
  4. Enter the Redirect URL provided in your queue's Email Sending Method settings.
  5. Click the Create button.
configuring the OAUTH client ID options for new credentials
  1. On the OAuth client created modal that displays after creating the application, copy the Client ID and Client secret.
    • You will need both of these when completing the setup within LibAnswers.
  2. Click the OK button to close the modal and return to LibAnswers to complete the rest of the email sending setup.
copying the client id and client secret values

Step 2. Activate Exchange Oauth in LibAnswers

Once the Client ID and Client Secret have been obtained during the app creation process, the LibAnswers Admin will use these to activate the LibAnswers queue to use Google OAuth email sending.

  1. Log into LibAnswers and go to Admin > Queues > Edit Queue () icon for the queue > Email tab.
  2. In the Email Sending Method panel, enter the Client ID obtained during the app creation process.
  3. In the Client Secret: Value field, enter the Client Secret obtained during the app creation process.
  4. Enter the Email Address you will be sending mail from.
    • This address must be the one for the account you authenticate with in the next steps.
  5. Click the Save button.
client ID, client secret, and email fields
  1. After saving, the Authenticate with Google button will appear. Click the button to complete the authentication process with Google.
    • Reminder: You must authenticate using the email address/account set above (the email address entered as a User when creating the Google Cloud project/app). 
authenticating with google button
  1. After authenticating, you will see the Current Authentication Token indicating that the connection was successful. To confirm the connection, we recommend sending test messages from your queue to a local email address and an external address.
    1. In the event that you need to reauthorize and request a new token, click the Re-Authenticate with Google button.
    2. If any changes have been made to the Client ID, Client Secret, or Email address, click the Save button to confirm the changes.
      • Making changes will also require you to run through the authentication process with Google again.
viewing the authentication token