cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Build Apps: query.authConfig.authToken always undefined

azabrdja
Explorer
0 Kudos
1,798

Hi all,
I have connected an API endpoint in SAP Build Apps that requires a bearer token as authorization in the header. When testing, the API works without any problems. The header setting looks like this:

In my SAP Build Apps application itself, I have created a data variable for this API in which I can enter a token for authorization:

Regardless of the input, whether hard-coded or not, I always get an "undefined" token displayed in the browser's network view at application runtime.

Does anyone know the reason for this?

Many thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

ItsMeGopi
Explorer
0 Kudos

Hi Dan Wroblewski,

Thanks for your valuable time😃!!!

I've created a CAPM with Postgres and deployed it to my CLOUD FOUNDRY. In addition I've created destination to access it.

Fortunately!! I am able consume the destination in FIORI applications its working absolutely fine😊, but I need to consume the destination in build apps as well.

However!! when I try to access the destination in build apps (directly), I am getting below error 

image.png

So what we have done, we decided to use "SAP BTP Destination Rest Api Integration" in build apps

image (1).png

Whenever i do test its working fine.

image (2).png

But while retrieving data using table/list...it still asking the bearer token.

image (3).png

But we already declared the formula to fetch the bearer token in common request header..

image (4).png

If I am missing something. please suggest what should be done, it will be helpful for us...!


 

 

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
But aren't you using the destination to handle the OAuth stuff? Why do you need to send the token? And if it is an OData service I would try to use the OData connection, where the URL must be the service document URL, not the metadata or a specific entity
ItsMeGopi
Explorer
0 Kudos

Hi Dan Wroblewski,

Thanks for your support😃!!!

Like you mentioned we made simple corrections on destination and now its working as expected😇!!!

damir_sef
Discoverer
0 Kudos

I am facing the same issue, have you found a solution? Thanks!