Posted in

Configuring Oracle Fusion REST API  with OAUTH 2.0 using Authorization Code flow (3 Legged Flow) with Fusion Domain

In this post, we will see how to configure OAUTH 2.0 authentication for Oracle fusion REST API using authorization flow (3 Legged flow).

Step1: Create Resource Server Confidential Application for authorization Code Flow in Fusion Domain.

Login to OCI.

Navigate to Identity & Domain —->Domains.

A screenshot of a computer
AI-generated content may be incorrect.

Get domain URL for this fusion domain:

Navigate to Integrated applications.

Click on Add application.

Select “Confidential Application” and click on Launch workflow.

Provide name and other details and click on Submit.

Navigate to Oauth configuration —> Edit Oauth configuration.

Select “Configure this application as a resource server now”.

Enable “Add Scopes” and click on Add.

Provide details as shown above and click on Add.

Click on Submit.

Navigate to Action –>Activate

Click on “Activate application”.

Step2: Create Client Confidential Application for authorization Code Flow in Fusion Domain.

Click on Submit.

Once Application is created, navigate to OAuth configuration —>Edit Oauth configuration

Select “Configure this application as a client now”.

Also select Allowed grant types as “Refresh Token” and “Authorization Code”.

Get OIC Runtime URL from OIC Console:

Prepare Redirect URL using OIC runtime URL as:

https://<oicURL>/icsapis/agent/oauth/callback

provide this URL under Redirect URL for confidential application.

Enable “Add resources” and click on Add scope.

Search resource server application which is created in earlier step and select the application.

Click on Add.

Click on Submit.

Once application is created, navigate to Actions —>Activate.

Click on “Activate application”.

Application is activated now.

Save the Client ID and Client Secret from application.

Step3: Create Service Account user in OCI.

Let us create new user in OCI for service account as “FUSION_OAUTH_USER”.

This user should be assigned Service Adminitrator role as while configuration the OIC connection, we need to login in OIC instance with the Service account user and provide consent.

Navigate to domain where we have provisioned our OIC instance.

Navigate to User Management —>Create.

Click on Create.

Once account is created, Activate the account.

This user should be assigned Service Adminitrator role.

Step3: Create same Service Account user in Fusion.

Login to Fusion.

Navigate to Tools —>Security Console

Click on “Add User Account”.

Provide details as shown above and click on Add Role.

Integration Specialist role is mandatory.

As we are going to test AP Invoice REST API, I have added AP related roles.

Click on Save and Close.

Add Data Access respective to these roles if applicable.

Step4: Create new connection in OIC

Login with same service account user (FUSION_OAUTH_USER) to OIC and create new REST connection.

Once above details are provided, click on “Provide Consent”.

Click on Next.

Click on Allow.

Now return to the connection and click on Test and then click on Save.

Step4: Test Authorization Code flow by creating new Integration.

Create new Integration to create AP Invoice in oracle fusion using connection created in earlier step.

Run this Integration.

Here we can see Invojce is created in Oracle fusion using Authorization Code flow.

Leave a Reply

Your email address will not be published. Required fields are marked *