We have a SPA that is protected with Azure AD. This seems to work fine, and users can authenticate
ok.
We also have a spring boot rest service, that is also secured by Azure AD. When we try to do an GET
from e.g. chrome, we get redirected to Azure for authentication, and then routed back to the rest service where we get the result.
But, when we try to call this rest service from SPA client, it does not work. Our client is running on http://localhost:5010/ and when we try to access the rest service, after the client itself successfully has authenticated against Azure, we just get a redirect to http://localhost:5010/login
This tells me that the rest service are not able to verify the clients authenication, but I don't understand why.
We use adal-angular4
in our SPA and adal4j
in our spring boot server.
How can I make the rest service accept tokens from SPA client, without trying to re-authenticate rest service?
According to the comment, you got these as headers:
Only Cookie is XSRF cookie, so it seems you're lacking authorization headers in your client app.