IBM Support

Email Listener OAuth Configuration with Office 365 - Generating a Refresh Token

How To


Summary

This document is part three of a series of related documents with the steps to set up email Listener OAuth Configuration with Office 365.

Email Listener OAuth Configuration with Office 365
https://www.ibm.com/support/pages/node/6566167

Disclaimer

The IBM Maximo Support team is willing to help customers to solve any difficulties regarding the approach theme. However, it’s suitable to mention that it doesn’t reflects as entirely responsible for changes of other companies involved and mentioned in this document. It is recommended to contact Microsoft for further information.

Steps

Follow the steps to obtain a refresh token from Microsoft Azure:

1. Download the script here and copy the file to the local drive under c:\dev\ps. Create the folders as needed.
2. Open maxsuplsnr.ps in a text editor and update: the Client ID, Client secret, Tenant ID (values obtained from Azure), and redirect URI (same used in Step 3 of the technote "email Listener Oauth Configuration with Office 365 - Azure Active Directory Application").
image-20220324161840-1
3. Save the script file.
4. Rename this file to have an extension of ps1 (PowerShell script).
5. Open a PowerShell prompt and execute the script.
image-20220324162015-2

If this error is displayed, the Windows policy has to be updated in order to allow the script execution.

image-20220324162056-3

Run the following command to update the Windows policy to Bypass:

Set-ExecutionPolicy -ExecutionPolicy Bypass


image-20220324162152-4

Confirm YES to Import the NuGet provider.

image-20220324162152-5


When the script is executed, it opens a small window to authenticate to your listener address and password.

image-20221005094759-1

                                                                                 
image-20221005094958-3
6. After you accept the permissions, a TXT file will be written in the same folder as the script. Open it and grab the refresh token (without the quotes) which is the latest entry in the file. The file name looks like “AuthInfo [date-time].txt”.
image-20221005095202-4
From the prior steps, you have the 4 values you need to configure the email Listener in Maximo and connect to Office365 over OAuth2:
  • Client ID
  • Client Secret
  • Refresh Token
  • Token URL
NOTE: IBM Support strongly recommend consulting the email service vendor and/or vendor documentation regarding the Refresh Token Lifespan and Expiration after inactivity. If a Refresh Token is expired, the script provided will help on retrieving a new one.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"ARM Category":[{"code":"a8m50000000CbU1AAK","label":"System Administration-\u003EE-Mail Listeners"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.6.1"},{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSRHPA","label":"IBM Maximo Application Suite"},"ARM Category":[{"code":"a8m50000000CbU1AAK","label":"System Administration-\u003EE-Mail Listeners"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
18 April 2024

UID

ibm16566161