Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
titleIn this article:

Table of Contents

The process is divided into 3 dependent parts:

  • Creating the Microsoft Azure App
  • Authentication through Terminal
  • Creating the Data Source in JeraSoft Billing

Creating the Microsoft Azure App

  1. Login to portal.azure.com with your Microsoft credentials, and go to Azure Active Directory.

  2. Go to the App Registrations page.

  3. Click the New Registration button.

  4. Register a new application using settings from the screenshot below:

  5. Save the Application (client) ID and Directory (tenant) ID values from the Overview tab of the freshly created app.

  6. Allow public client flows from the Authentication tab of your application:

  7. Now, you have to add some permissions to your application - it should be IMAP.AccessAsUser.All (to be able to login to your mailbox) and offline_access (to be able to refresh token on Email Rates Manager’s demand).




    As a result, you should have 2 permissions added to your application:

Authentication through Terminal

  1. Download the obtain_refresh_token.py script to your computer.
  2. Open the terminal, go to the directory where the downloaded script is located (using cdcommand), and execute the following command, which will install the needed for authentication python package:

    Code Block
    pip3 install msal


  3. Next, run the script itself using the following command:

    Code Block
    python3 obtain_refresh_token.py <CLIENT_ID> <TENANT_ID>

    , where CLIENT_ID is an Application (Client) ID, TENANT_ID - Directory (Tenant) ID. You obtained these values during the previous steps.
    As a result, you should see the message like in the screenshot below. Go to https://microsoft.com/devicelogin and enter the code you see in the terminal. Next go through the authentication process and grant the required permission to the application.
    WARNING: Do not close the terminal during the authentication process.

  4. If the authentication process was completed successfully, you will see the ‘success’ message in the terminal. Please save the refresh_token value. You will need it to create the Data Source in JeraSoft Billing later.

Creating the Data Source in JeraSoft Billing

  1. Log in to JeraSoft Billing, open Integration -> Data Sources tab, and click the Add Source button;
  2. Choose the IMAP Microsoft [OAuth2] connection type and fill in the Name, Login, Client ID, Tenant ID, and Refresh Token fields. The Host field is pre-filled with the outlook.office365.com value, and you should not change it.
  3. Click Apply.

Once the steps above are completed, you can choose the freshly created Data Source as a source for Automatic Email Import in the Rate Tables settings.