Adaptive Forms Integration with external APIs via user's Access token | Community
Skip to main content
Level 2
March 27, 2024

Adaptive Forms Integration with external APIs via user's Access token

  • March 27, 2024
  • 2 replies
  • 728 views

Hi there,
I'm working on a requirement where we have to create a "Service Request Form" via Adaptive Form and pre populate the customer data on page load via calling some external APIs. These APIs expecting "Access token" to give us the user's bank account details. 

We've created a OAuth Service which connects to some other APIs and give us the access token and now we need to pass that access token from AEM to external APIs, gets the user specific data and prefilled the Adaptive forms.

We're trying to figure out a best way forward for this requirement to implement from Adaptive forms perspective. Kindly let me know your thoughts.


Approach 1:  Create Custom Javascript to make a ajax call to Servlet. This servlet will connect to external APIs and get the response.

Approach 2: Use Custom Authentication OOTB feature of Adaptive forms to create the datasource but I did not find any reference how we can utilize this ootb feature our requirement.


Pls let me know your thoughts on this or if anyone has worked on similar kind of requirement before.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
March 27, 2024
Level 2
April 8, 2024

I've tried this option too but it doesn't seem to work. 

Adobe Employee
August 22, 2024

Hi
If the OAuth service which you have created is designed as per OAuth spec. Then you can use the OAuth authentication directly which we provide out of the box. No extra efforts required, just provide the auth details such as client id/secret/access token url etc and we are good to go. Screenshot attached.

If it's some sort custom logic for authentication to retrieve access token, then you can implement custom authentication and write your own logic to retrieve access token which will be used by all the api's in the configuration/swagger which connects to external system. Configuration and sample attached.

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/forms/integrate/use-form-data-model/configure-data-sources