Closed Wissperwind closed 2 years ago
AFAIK, this is outside the scope of this plugin and has to be configured in the permissions of Keycloak itself.
I thin I found a way... The Code:
def has_superuser_perm(self, token):
"""
Check if token belongs to a user with superuser permissions
"""
print(self.client_roles(token))
if self.client_admin_role in self.client_roles(token):
return True
print(self.realm_roles(token))
if self.realm_admin_role in self.realm_roles(token):
return True
return False
Just use roles. Users that have the realm admin role in the configuration can login into admin.
@Wissperwind this is outside of the scope of this plugin. Still, I am glad you found a solution.
I don't think so. It is the scope of keycloak to tell what roles a user has. It is the scope of the application, that is this plugin and django, to decide which role allow to do what. So as I implemented, the client decides that it let specific users in a specific gropu into the admin area.
Hi,
Is there a way to let only specific users log in into the admin area?