Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4449

How to send access token in Telerik report using abp framework

$
0
0

I'm working in and ABP + Blazor project, we are using Telerik for blazor. I've testing how a report(.trdp file) works. So I've integrated a report as Telerik's documentation expecified.

This report is working fine, but I need to send 2 required params.access_token and request_verification_token as header params.

enter image description here

request_verification_token is saved as a cookie, so this work is done!.

access_token based in documentation must be in ICurrentUser , but acces_token property allways is empty or null.

I really don't know about blazor or abp are working in this project(It's my first project on)

Note: In another project, they are working with abp + angular. So when you get login the access token is set to all http request and store in user session.

Now, When I call a report, telerik reports make a api call to my abp backend, thats why I need access token.

I need to get acces token fron the current user, I've trying with: ICurrentUser and IAuthTokenProvider

this my code

Blazor component:

@if(showVisor){//this is a personalized component that's use ReportViewer from telerik<AgriculturalTasksReportViewer         IsVisible="true"         ReportName="rptAgriculturalTasks_WorkPart"        ReportParameters="@viewerParams"></AgriculturalTasksReportViewer>}

Blazor code:

// boilerplate codeviewerParams.Add("ProcessDateMin", StartDate); viewerParams.Add("ProcessDateMax", EndDate);viewerParams.Add("FarmIds", farmIds);viewerParams.Add("SectorIds", sectorIds);viewerParams.Add("LotIds", lotIds);viewerParams.Add("ReportName", "Texto de detalle en header");viewerParams.Add("GeneratedFrom", "192.168.0.1");showVisor = true;

enter image description here

Something like this I've expecting.here in viewerParams I need to add this token

var currentUser = CurrentUser;var userName = currentUser.UserName;var token = currentUser.FindClaim("access_token");//then set the tokenviewerParams.Add("token", token );

Note: Sorry for my English.

Note: Thanks for any help


Viewing all articles
Browse latest Browse all 4449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>