in my App (Angular 2 / Ionic 2) I implemented my own login/authentication. Basically it works like this: On login, username and password is being validated by the PHP backen
This answer helped me : link
It shows how to add it in the backend and how use it in the frontend
Java backend:
public void methodJava(HttpServletResponse response){
...
response.addHeader("access-control-expose-headers", "Authorization");
}
And access the header on angular like this:
return this.http
.get()
.map(res => console.log("cookie: " + res.headers.get("Authorization") )
}