The most secure way of importing email messages from Gmail is by using OAuth 2.0 authorization. It allows the app to access Gmail accounts without storing any user passwords and without using older and less secure authentication methods.
To use this Import method on-premises, your server must have a public SSL domain with an internet access.
Creating Google App
To enable import from Gmail, first you need to create an app in Google that will configure access and authorization settings, which will then be used by Ultimate Forms to gain access to the mailbox data.
- Log into Google API Console at https://console.cloud.google.com/
- Create a new project and provide a descriptive name
- Switch to the newly created project.
- In the main menu, click on APIs and Services, then Library
- Search for Gmail, then select Gmail API.
- Click on Enable.
- Once the API is enabled, proceed to configure the OAuth consent screen. It will be shown when you establish the connection to the app from the Import profile in Ultimate Forms. Click on OAuth consent screen in the menu on the left.
- If you are a Google Workspace user, you can choose to limit the app to internal users only, otherwise you have to select External
- Click on Create.
- Now enter the required fields:
- App name - a descriptive name, such as Support email import.
- User support email - select your own user.
- Authorized domain - enter infowisesolutions.com for usage in SharePoint Online or your site collection external domain for usage on-premises. It will allow our app to send authorization requests.
- Developer contact information - enter your own email (doesn't have to be a gmail account).
- Click on Save and Continue
- Under Scopes, search for Gmail and select https://www.googleapis.com/auth/gmail.readonly
- Note: this is one of restricted scopes, which means it requires a higher level of scrutiny to be approved. You don't actually need to approve the app though, as it's going to only be used internally.
- Click on Save and Continue.
- Under Test Users, enter the email of the Gmail mailbox[es] you are planning to import from. In most cases it will be the same email as the user who is creating the app, but there is no actual limit.
- Click on Save and Continue, you can overview your changes now.
- Now click on Credentials. Here we will configure the client ID and client secret pair to be used by Ultimate Forms.
- Click on Create Credentials at the top and choose OAuth client ID.
- Under Application type, select Web application.
- Under Name you can enter Ultimate Forms.
- Under Authorized redirect URIs enter https://www.infowisesolutions.com/apps/uf/FormConnection/SFTokenReceived for SP online, or {Your site collection external URL}/_layouts/15/Infowise/Settings/SFTokenReceived.html for On-premises.
- Click on Create.
- Copy Cliend ID and Client Secret that you are now shown.
- You are done configuring the Google app.
Configuring Import Profile
- Open Ultimate Forms and select list, form or object where you want to set up an import profile.
- Click on Import to switch to import settings.
- Click on Add new profile, then enter a name for the new profile.
- Switch to Data provider tab.
- Select Gmail protocol.
- Enter client ID and client secret of the Google app.
- Click on Connect. A pop-up will be shown, make sure pop-up blocker is disabled.
- In the pop-up, choose the Google account you want to import from.
- A warning is now shown, choose Continue.
- Ensure all access scopes are selected and click on Continue.
- Actions tab will now become visible and you must create at least one action.
- Note that you do not need to make any changes to Client ID or Client Secret in the future, they are stored safely within the profile. Client Secret will not be shown again inside the profile.