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:

  1. anchor tags can't add authorization headers request, xhr can.
  2. xhr requests 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

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -