I have created web application in angular 2 for the client side and NodeJS
with express
framework for the server-side.
For the client side, I generated the project with angular-cli
which runs on a lite-server
, so my client and server are running on 2 different services.
I want to integrate ADFS
authentication.
To implement the authentication, I am using passport-saml
package.
There is a middleware in my server-side API
which requires a user to authenticate.
The authentication process works fine when reaching the server directly (without the client).
However, I fail to access the API
through the @angular/http
.
I tried a simple GET
request from the server (with the middleware in the end-point) and as a result I am getting the authentication page without redirection (I don't think it's the core problem, but the actual implementation is).
How should I properly implement the authentication when using separate services to the server and the client?