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.
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;
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