identityserver3 - How to download a file secured with IdentityServer -
i want able download file api call. argument's sake, let's it's automagically generated pdf file.
i have 2 problems:
- anchor tags can't add
authorizationheaders request,xhrcan. xhrrequests cannot download files.
my solution write api [allowanonymous] end point in it, takes access_token parameter. validate access token hand , return 401 or stream pdf.
is there better solution or, if best solution, how validate access_token within api?
this approach totally fine.
if want use middleware validate token - depends middleware using. plain microsoft jwt bearer middleware has events can implement retrieve token query string alternatively.
the identity server token validation middleware has tokenretriever property allows retrieve tokens multiple/alternative locations.
Comments
Post a Comment