Page 1 of 1

Call to .NET core API from angular designer component

Posted: Tue Sep 15, 2020 12:38 pm
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.

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

Posted: Wed Sep 16, 2020 6:10 am
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.

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

Posted: Wed Jan 18, 2023 2:18 pm
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.

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

Posted: Wed Jan 18, 2023 10:18 pm
by Lech Kulikowski

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

Posted: Thu Jan 19, 2023 11:54 am
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!

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

Posted: Fri Jan 20, 2023 12:00 pm
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'"