I have an Angular 2 app that runs on another server than a Spring Boot based Gateway. All the Angular queries go through this gateway.
I have set up the gateway as a Spring Security resource server, which uses an external OpenID Identity Provider. When I log in from the gateway on the OpenID server; it's all ok, the IDP returns me the token containing every single infos I need to manage the user.
But, I have to initiate the connection from the Angular2 app, and get back the token to store it client side, to be able to send authenticated requests.
When logged in, the OpenID IDP return to my Gateway the token, but how can I give this token back to my front-end ? I feel dumb right now I can't figure this out, like a missing link that seems to be so obvious but I cant think about it :(
EDIT: I found someone in the same case as me ( = wobbly situation) : stackoverflow.com/questions/23648716/redirecting-to-external-page-angular I'll try to send credentials from Angular app to my backend, then make a HTTP query to the remote page (instead of using the form to log in) and then return back the answer to the client.
Thanks a lot !