My Question: How do I Secure my Node JS API with JWT Token having Shibboleth SSO as the Authentication mechanism?
[MY APPLICATION FLOW]
- I have an AngularJS App and a Back-End Node JS App.
- AngularJS App communicates with the Back-End App through API's exposed over HTTP.
- Now the Authentication in AngularJS App is achieved using Shibboleth SSO which is working perfectly fine.
- In Shibboleth SSO, the User is getting authenticated against an IDP and hence I don't have the control during the Login mechanism. In other words, IDP is out of my control.
- Once authenticated, Shibboleth returns the required Data about the User to the AngularJS App.
- And then the AngularJS App communicates with the Back-End App through API to fetch some Data.
[NORMAL JWT SCENARIO TO SECURE API]
- The user attempts Login from Front-End App which will call a Login API at the Back-End by sending Username and Password.
- At Back-End, if the User exists, the Back-End generates a JWT Token and send it back to the User.
- The User will utilize that JWT Token to make further API calls. And the Back-End can verify the Token and respond appropriately.
- Hence Securing the API and preventing unauthorized access.
[MY JWT SCENARIO AND PROBLEM]
- When the User will arrive at Front-End AngularJS App, the User would have already been authenticated.
- And now the AngularJS App will make some API calls to the Back-End for some data.
- [Problem/Question]: How do I secure my Back-End API from Unauthorized Access?
[AN APPROACH WITH A FLAW]
- [Approach]: I can create a Login API in my Node JS App which will accept Username and Password that I have received from Shibboleth SSO and generate a JWT Token at the Back-End. And make the Back-End return that JWT Token as a Response. Which can be further utilized by the User to make API calls.
- [Flaw]: But the Problem with this Approach is: How do I authenticate the legitimacy of the Username and Password that I am receiving from the Front-End?
So again My Question is: How do I Secure my Node JS API with JWT Token having Shibboleth SSO as the Authentication mechanism?
I hope, I might have explained my scenario properly. Any help, guidance, or a right direction will be appreciated.
Thanks :)