-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional properties in JWT token not accessible #9914
Comments
maybe helpful - https://github.com/Service-Soft/lbx-jwt |
@johndpope Thanks. The lbx-jwt repository is really helpful. I have replaced my code with the repository, as I couldn't quite figure out what went wrong with my implementation. |
Perhaps it was an import package error. import {JWTService} from './services/jwt.service'; |
Describe the bug
I am trying to access my User model's "roles" properties. I am using the @loopback/authentication-jwt package for JWT authentication.
I have tried to bind a custom JWTService with application.ts as follows:
this.bind(TokenServiceBindings.TOKEN_SERVICE).toClass(JWTService);
The custom JWT Service is as follows:
Now I decorated an endpoint in the following way:
But the JWT service never seems to get triggered.
The basicAuthorization of my decorator is as follows:
However, roles is undefined here.
How can I solve this?
Logs
No response
Additional information
No response
Reproduction
The text was updated successfully, but these errors were encountered: