Reading of "permissions" claim of access token #82
-
Hello, The access token I get from my Keycloak contains "scope", "roles" and "sub" claims but not "permissions" claim that the BaseFief object is trying to read at this part of the code : ( fief_client/client.py )
This creates a KeyError and then raises a FiefAccessTokenInvalid exception and then an http 403 error. Am I using the library right ? Do I misunderstand something about roles / permissions ? I thought at this part of the code, after having checked the scope, the library would check the roles so I'm wondering if permissions checking is the same. Thank you very much in advance for your help, Thibault |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @Pijako, welcome to Fief 👋
The Fief Python client is designed to work with Fief, not Keycloak 🙃 In a way, we are a "competitor" to Keycloak; and we may not structure our access token the same way as them. In Fief, we define the |
Beta Was this translation helpful? Give feedback.
Hello @Pijako, welcome to Fief 👋
The Fief Python client is designed to work with Fief, not Keycloak 🙃 In a way, we are a "competitor" to Keycloak; and we may not structure our access token the same way as them.
In Fief, we define the
permissions
claim to list the permissions a user has access to. When you assign a role, the user is granted the associated list of permissions; so it makes sense to check for actual permissions rather than a role. Ref: https://docs.fief.dev/getting-started/access-control/