Call to .NET core API from angular designer component

Stimulsoft Reports.WEB discussion
Post Reply
vito.abeln1
Posts: 2
Joined: Wed Jul 29, 2020 12:43 pm

Call to .NET core API from angular designer component

Post by vito.abeln1 »

Hello,

I am creating an angular application that implements the stimulsoft angular designer and viewer component. In the application I have an interceptor that adds an authentication token to all outgoing http requests. It intercepts the request being sent from the viewer component. But it does not intercept the sent request from the designer component. Are they using different http libraries for sending requests?

How can I add authentication to the call from the designer component, since i cant add authentication headers to a string and the interceptor does not intercept the request?

Greatly appreciated.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Call to .NET core API from angular designer component

Post by HighAley »

Hello,

You could try to handle the event of the report this way:

report.onBeginProcessData = function(e) {
e.headers.push({ key: 'Authorization', value: 'Bearer eyJraWQiOi...' });
};

Or do the same for the designer.
If you can't handle the event, please, upgrade to the latest build.

Thank you.
diogo@forlogic.net
Posts: 10
Joined: Tue Jan 10, 2023 8:38 pm
Location: Brazil

Re: Call to .NET core API from angular designer component

Post by diogo@forlogic.net »

Hello!

Which designer event should be handled to add the Authorization header?
Where can I find the available events for the component "stimulsoft-designer-angular"?
Is there a link with this component docs?

Thank you.
diogo@forlogic.net
Posts: 10
Joined: Tue Jan 10, 2023 8:38 pm
Location: Brazil

Re: Call to .NET core API from angular designer component

Post by diogo@forlogic.net »

Hello!

These links don't have documentation about the Angular "stimulsoft-designer-angular" component.

Which designer event should be handled to add the user token in Authorization header?
I already use a module http interceptor, but for the designer requests it is not working.
How can I set headers in requests from the designer? Is there a sample code?

Thank you!
Vadim
Posts: 362
Joined: Tue Apr 23, 2013 11:23 am

Re: Call to .NET core API from angular designer component

Post by Vadim »

Hello.

There is only one way to transfer parameters to designer controller by url pameters in [requestUrl]="'http://localhost:60801/api/designer?param=value&p2=v2'"
Post Reply