You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been stuck for some time, trying to get loopback4-authentication with BearerToken and @loopback/authorization to work together. The problem I am having, is that when I try to request a endpoint with the following decorator:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello community,
I have been stuck for some time, trying to get loopback4-authentication with BearerToken and @loopback/authorization to work together. The problem I am having, is that when I try to request a endpoint with the following decorator:
@authenticate(STRATEGY.BEARER)
@authorize({allowedRoles: ['user'], })
@get('/hellouser')
hellouser(): string {
return 'Hello user!!';
}
The response is 403 access denied.
While debugging the code, it seems like authorizationCtx.principals.length is always 0, of my AuthorizationProvide.
So my question is, have do I get the user profile to be a principal?
Hope someone can help me.
Regards,
Jens Christensen
Beta Was this translation helpful? Give feedback.
All reactions