Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Initial roles (#33)
Browse files Browse the repository at this point in the history
* fixed intial roles

* initial roles does additional requests

Co-authored-by: Yannic Schröer <[email protected]>
  • Loading branch information
yannicschroeer and Yannic Schröer authored Mar 27, 2022
1 parent f35e6ff commit 7f0a073
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 446 deletions.
2 changes: 1 addition & 1 deletion fastapi_keycloak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Keycloak API Client for integrating authentication and authorization with FastAPI"""

__version__ = "1.0.3"
__version__ = "1.0.4"

from fastapi_keycloak.api import FastAPIKeycloak
from fastapi_keycloak.model import OIDCUser, UsernamePassword, HTTPMethod, KeycloakError, KeycloakUser, KeycloakToken, KeycloakRole, KeycloakIdentityProvider, KeycloakGroup
Expand Down
4 changes: 3 additions & 1 deletion fastapi_keycloak/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ def create_user(
"firstName": first_name,
"lastName": last_name,
"enabled": enabled,
"realmRoles": initial_roles,
"credentials": [
{
"temporary": False,
Expand All @@ -682,6 +681,9 @@ def create_user(
user = self.get_user(query=f'username={username}')
if send_email_verification:
self.send_email_verification(user.id)
if initial_roles:
self.add_user_roles(initial_roles, user.id)
user = self.get_user(user_id=user.id)
return user

@result_or_error()
Expand Down
Loading

0 comments on commit 7f0a073

Please sign in to comment.