I'm trying to understand how I can fit a custom JWT routing into loopbacks security model. My application has an authentication "dance" involving SMS that results in a valid JWT token using the excellent description. I'm using the jsonwebtoken and things work as expected. After obtaining the token my angular.js client sends the token with each request in the Authorisation: JWT ..token..
header (found conflicting documentation, one says JWT, one Bearer, but I can figure that out).
Now I want to make use of the token inside a loopback application. I'd like to use the ACL system loopback provides. I did read the following resources:
- Authenticate a Node.js API with JSON Web Tokens
- Loopback, loggin in users
- Third-party login (Passport)
- Loopback, making authenticated requests
- Passport strategy for JWT
- Loopback OAuth2.0 source
- Loopback satelizer
And I'm not clear what my next steps are. I have working:
- User 'login' - generating a JWT
- User login using username/password (to be retired)
- Working ACL implementation in loopback (when I access an ACL protected resource I get, as expected a 4xx error)
- My JWT token properly (?) in the header of the request
I need:
- based on the JWT token a valid user with roles compatible to loopback ACL
Help is very much appreciated