I have my angular 5 app and Java Rest APIs deployed in the same Jetty container (same server and same port).
I have a rest API, which if accessed without authentication, is redirected to SSO (external domain), user logs in and user is redirected back to called rest api. This flow is working fine if the api is accessed directly from browser.
However, I am not able to figure out how to do the same with my angular app.
this.http.get('http://localhost:4400/api/test/sso',
{ observe: 'response' })
.subscribe(
res => {
console.log("SSO respnse= "+res);
} ,error => {
console.error(error);
}
);
Nothing happens.
However,hitting http://localhost:4400/api/test/sso directly in browser works as expected and redirection happens without any issue.
Also, the other Rest api that return a simple response are working fine from angular app. It is just this api which redirects to an outside domain, which is not working from angular app.