P2PI setup with OAuth

We can set up communication between platform instances using OAuth instead of username/password.

For the purposes of this example, we will assume that the Instance1 wants to call Instance2.

  1. Instance2 would load an OAuthIBClientApp into its local DB.

    You can create an OAuthIBClientApp either by loading csv/xml or by clicking create button defined in a report from the following WebAction.

    <WebAction name="PLT.OAuth.OAuthIBClientAppReport">
    <PanelOptions>
    <PanelClass>One.Report</PanelClass>
    <PanelConfig>{reportName: 'PLT.OAuthIBClientAppReport', autoExecute: true}</PanelConfig>
    </PanelOptions>
    </WebAction>

  2. Instance1 would load an OAuthOBClientApp into its local DB, plugging in value for client App Id and Secret from previous step 1.

  3. You can create an OAuthOBClientApp by clicking create button defined in a report from the following WebAction.

    <WebAction name="PLT.OAuth.OAuthOBClientAppReport">
    <PanelOptions>
    <PanelClass>One.Report</PanelClass>
    <PanelConfig>{reportName: 'PLT.OAuthOBClientAppReport', autoExecute: true}</PanelConfig>
    </PanelOptions>
    </WebAction>
  4. Create Platform Instance record for Instance 1.

    You can create a Platform Instance by clicking the create button defined in a report from the following WebAction.

    <WebAction name="PlatformInstanceReport">
    <PanelOptions>
    <PanelClass>One.Report</PanelClass>
    <PanelConfig>{reportName: 'PLT.PlatformInstanceReport', autoExecute: true}</PanelConfig>
    </PanelOptions>
    </WebAction>


  5. While creating the platform instance, do not provide username/password. On the subsequent update page, select "Use OAuth-based authentication" and in the OAuthOBClientApp field populate the OAuthOBClientApp created in step 2. Click on the "request" link as shown in the following screenshot and complete the OAuth authorization flow.

    images/download/attachments/144836142/p2pi_request_link-version-1-modificationdate-1645137527000-api-v2.png


    After this flow completes, a new OAuth token will be assigned to Platform Instance 1. (You can refresh and see the token assigned to Instance 1 from Instance 2.) This OAuth token will be used for authorization in P2PI communication between Instance 1 and Instance 2.