Google OAuth Authentication
OAuth is a standard for authorisation in the field of technology, which allows users to authorise an app or service to sign in to another without revealing sensitive information such as usernames or passwords. The OAuth 2.0 protocol is used for authentication and authorisation with Google APIs.
Step-by-Step Process
- Sign in or create an account on Google Cloud Platform
- Click Select a Project

- Press New Project

- Fill in the Project Name field

- When you are done, click Create

- In Notifications, click Create Project: Invent ERP

- Click on the Navigation menu (3 horizontal bars) in the top left corner

- Click APIs & Services then OAuth consent screen

- Choose a User Type, Select Either Internal or External.

- After that, press Create

- Fill the App Name field under App Information

- Fill the User support email field under App Information

- Click Add Domain

- Click Authorized domain 1 and enter a domain for example Invent ERP’s website

- Press on Email addresses

- After that, click on Save and Continue

- Press on Save and Continue again

- If you chose the External under User Type then you will continue to Test Users. Click Add users

- Fill in the blank under Add Users

- Then click Add

- Click Save and continue

- Select Back to dashboard

- When you are all done, simply press Publish App

Navigate to Invent ERP
- Using the left sidebar menu, under Configuration select Settings

- Then click on Technical then choose Mail Server then Mail Servers.

- Press Add

- Fill in the Mail Server Description field

- Choose Gmail OAuth Authentication in the Authenticate Using drop-down menu

- Click on Copy

- Navigate to (console.cloud.google.com)

- Select Credentials

- Then Press Create Credentials

- Choose OAuth client ID

- Select Application Type

- In the Name field, enter Invent

- Click on Add URL

- Paste the URL you copied earlier from Invent ERP

- Then Press Create

- The next step is to click Copy Client ID

Step 2: Configure OAuth Consent Screen
- Open the side menu and go to APIs & Services → OAuth Consent Screen.
- Choose a User Type and click Create.
- Fill in the App Name and User Support Email.
- Click Add Domain and enter
inventerp.com. - Add developer contact information and click Save and Continue.
- Add test users if using External user type.
- Click Back to Dashboard and then Publish App.
Step 3: Configure Mail Server in Invent ERP
- Log in to Invent ERP.
- Go to Configuration → Settings → Technical → Mail Server → Mail Servers.
- Click Add, fill in the Mail Server Description.
- Choose Gmail OAuth Authentication under Authenticate Using.
- Click Copy to copy the OAuth2 Redirect URL.
Step 4: Create OAuth Credentials in Google Cloud
- Go to APIs & Services → Credentials → Create Credentials → OAuth Client ID.
- Select Web Application as the application type.
- Enter a client name and paste the OAuth2 Redirect URL under Authorized Redirect URIs.
- Click Create.
- Copy the Client ID and Client Secret.
Step 5: Finalize in Invent ERP
- Paste the Client ID and Client Secret in the Mail Server form.
- Enter your Gmail address as the Username.
- Click Create.
- Scroll down and click Connect Your Gmail Account.
- Authorize the app in Google.
- Verify that Token Valid is displayed.
- Click Test Connection to confirm the setup.