Safe HaskellNone




This module helps you manage users in Keycloak. You can create, read and update users. To activate this, you need to give the role "manage users" to your user in Keycloak. For this, go in your user, select the "Role mappings" tab. Then in "client Roles", select "realm management" and assign the role "manage-users".

Example usage:

-- Get a JWT from Keycloak. A JWT can then be used to authenticate yourself.
jwt <- getJWT "demo" "demo" 

users <- getUsers Nothing Nothing Nothing jwt
liftIO $ putStrLn $ "All Users: " ++ (show users)


getUsers :: Maybe Max -> Maybe First -> Maybe Username -> JWT -> Keycloak [User] Source #

Get users. Default number of users is 100. Parameters max and first allow to paginate and retrieve more than 100 users.

getUser :: UserId -> JWT -> Keycloak User Source #

Get a single user, based on his Id

createUser :: User -> JWT -> Keycloak UserId Source #

Create a user

updateUser :: UserId -> User -> JWT -> Keycloak () Source #

Get a single user, based on his Id