angularjwtpassport.jssamlpassport-saml

Angular 4: Authentication with SAML and Token exchange


I am working on setting up Angular 4 + NodeJS (for SAML-PASSPORT) + Spring Boot (all APIs) application.

This is the authentication and authorization flow: 1. In UI, user click on Login 2. Request is sent to SAML IDP for login 3. User authenticates himself 4. SAML IDP POSTs back on to my NodeJS API endpoint /login/callback 5. NodeJS redirect the user to front end - At this point I would like generate a Token and send it to the UI side. I cannot send it via URL

How would you solve this problem of sending User Detail/Token from NodeJS after SAML authentication to the front-end

In Angular 4, is there a Servlet like concept where I hit a route but the Route is capture behind the scene which showing the User the Token or details in the URL.

I don't want to do this: http:///landing/token=5384742894

I feel like this is a already solved problem, I am just not sure what is the right way to it.


Solution

  • I ended up using Cookie to send the key data over