How to handle file downloads with JWT based authentication?

前端 未结 5 734
北荒
北荒 2020-12-07 07:24

I\'m writing a webapp in Angular where authentication is handled by a JWT token, meaning that every request has an \"Authentication\" header with all the necessary informati

5条回答
  •  死守一世寂寞
    2020-12-07 08:10

    I would generate tokens for download.

    Within angular make an authenticated request to obtain a temporary token (say an hour) then add it to the url as a get parameter. This way you can download files in any way you like (window.open ...)

提交回复
热议问题