Skip to main content

Sample configuration for IMAP using OAuth2 authentication for polling mails from Gmail in KIC

Article # 3050014 - Page views: 267


How to configure IMAP Gmail polling using Oauth2 authentication.


This is a sample setup for polling emails from Gmail via IMAP using OAuth2 authentication.

Using guides like these:
you can setup your own Project to enable the Gmail API in order to setup and get the "Client ID" and "Client Secret" you need for logging in.

Gmail Oauth - Google Overview1.png

Here you can see the Credentials page for a Web application called "KIC - OAuth" for a Project called "KFXGoogleOauth".

Gmail Oauth - Google Overview2.png

If you already have your project ready to go, take note of your "Client ID", "Client Secret" and "Redirect URI".

In KIC the configuration looks like this:
Create a new mailbox import and configure your user.

Gmail Oauth - KIC mailbox settings.png

Click on "Configure OAuth" and subsequently on "Manage" to create a new Authorization Server.

Gmail Oauth - Manage Authorization server.png

Create a new Authorization Server by clicking "Add" and enter the needed urls as they are documented here in the Online documentation.

Gmail Oauth - KIC Auth server.png

Click OK and Select this newly created Authorization server in the "Configure OAuth" window.
Also add your "Client ID", "Redirect URI" and "Client Secret".

Gmail - Oauth - KIC Oauth config1.png

Click "Authorize" and log in with the configured user.
After logging in with the user name and password and allowing the app to access the mailbox, a new webpage pops up.

Gmail Oauth - Google Log-in1.pngGmail Oauth - Google Log-in2.png

Since we're using "https://localhost:8080" as the Redirect URI, this page doesn't show much.

Gmail Oauth - copy url.png

Copy the contents of the Address bar of this page and paste it into the "Authorization code" field in your KIC configuration.

Gmail Oauth - Past url.png

Now click on "OK" and if everything was set up correctly, a new pop-up should be shown that shows "Login successful"

Gmail Oauth - KIC Authorize result.png

Click "OK" again, the "Configue OAuth" window automatically closes and you can now click the "Test Mailbox" button prior to exiting out of the configuration and restarting the Plug-in.

Gmail Oauth - KIC - Test mailbox.png

Level of Complexity 



Applies to  

Product Version Build Environment Hardware
Kofax Import Connector 2.10 FP3    


Add any references to other internal or external articles



Article # 3050014