I am developing a RESTful API with Spring Boot
and secured with oAuth2.0
(via Spring Security
) and my frontend in AngularJS.
I need to download a file and every post I read says (and I understand) that I should use window.open('urlToTheFileEndpoint');
But doing it that way, I cannot add the security header (like all my other ajax request), so the API does not allow my request to be completed.
Is there a way to handle this? Or should I make this file endpoint unsecure?