76
Views
8
Comments
[OutSystems Data Grid Web] Consume protected API
Question
outsystems-data-grid-web
Web icon
Forge asset by OutSystems

Hi,

We have a secured API and need to include Authorization header to request. How should I pass this header (or any other) to "RestURL " attribute? 

Thank you

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Mykola,

I think that's a non-supported scenerio. However, as a work-around you could create a local proxy REST service that consumes the secured API, passing along the input and output.

2021-05-05 13-05-18
Mykola (Nick) Tkachenko

Hi Killian. 

What do you mean by local proxy REST? Expose unprotected API that makes call to protected API via OS Consume Node passing all needs headers? 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Mykola (Nick) Tkachenko wrote:

What do you mean by local proxy REST? Expose unprotected API that makes call to protected API via OS Consume Node passing all needs headers? 

Yes, that's what I had in mind. To make it more secure, you can add "local" security like Marcelo described.


2019-05-22 11-30-09
Marcelo Ferreira

Hi,

What we did was to make a protected REST call on the preparation to create a token and than we use that token to call the rest of the grid.

Regards,

Marcelo

2021-05-05 13-05-18
Mykola (Nick) Tkachenko

Marcelo Ferreira wrote:

Hi,

What we did was to make a protected REST call on the preparation to create a token and than we use that token to call the rest of the grid.

Regards,

Marcelo

I have a token generated on preparation, How should I pass add it to RestURL as Authorization header? 


2019-05-22 11-30-09
Marcelo Ferreira

Hi,

So you called the protected REST and it returns a token that was saved on the DB of that module. Than you can call the grid REST with the token as parameter. The grid REST will check the db if the token exists and didn't expire. the Expiration date can be just a couple of seconds.

Regards,

Marcelo

2021-05-05 13-05-18
Mykola (Nick) Tkachenko

So token will be sent in URL as a parameter? 

In this case we can't just use oAuth2 component as it checks  https://www.outsystems.com/forge/component-overview/3573/oauth2-provider

Can we somehow use local text variable instead of grid RestURL ?

2019-05-22 11-30-09
Marcelo Ferreira

Hi,

I didn't find a way of doing it. Even if is not ideal for us we still use REST URL's when using data grid. Maybe if you change the Data Grid itself.

Regards,

Marcelo

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.