module Keycloak::UserClient

Direct including types

Defined in:

keycloak/client/user.cr

Instance Method Summary

Instance Method Detail

def create_user(user : Representation::User) #

[View source]
def delete_user(id : String) #

[View source]
def get_user(id : String, klass = Representation::User) #

[View source]
def get_user_credentials(id : String) : Array(Representation::Credential) #

[View source]
def reset_password(id : String, cred : Representation::Credential) #

Set up a new password for the user.

  • id the id of the user
  • cred the new credentials

[View source]
def send_verify_email(id : String, *, client_id : String | Nil = nil, redirect_uri : String | Nil = nil) #

Send an email-verification email to the user An email contains a link the user can click to verify their email address.

  • id the id of the user
  • client_id optional client id
  • redirect_uri optional redirect uri

[View source]
def update_user(user : Representation::User) #

[View source]
def user_count(*, email : String | Nil = nil, email_verified : Bool | Nil = nil, enabled : Bool | Nil = nil, firstname : String | Nil = nil, lastname : String | Nil = nil, search : String | Nil = nil, username : String | Nil = nil) : Int32 #

Returns the number of users that match the given criteria. It can be called in three different ways:

  1. Don’t specify any criteria and pass. The number of all users within that realm will be returned.
  2. If search is specified other criteria such as lastname will be ignored even though you set them. The search string will be matched against the first and lastname, the username and the email of a user
  3. If search is unspecified but any of lastname, firstname, email or username those criteria are matched against their respective fields on a user entity. Combined with a logical and.

Params:

  • email A String contained in email, or the complete email, if param "exact" is true
  • email_verified whether the email has been verified
  • enabled Boolean representing if user is enabled or not
  • firstname A String contained in firstName, or the complete firstName, if param "exact" is true
  • lastname A String contained in lastName, or the complete lastName, if param "exact" is true
  • search A String contained in username, first or last name, or email
  • username A String contained in username, or the complete username, if param "exact" is true

[View source]
def user_groups(id : String, *, brief : Bool | Nil = nil, first : Int32 | Nil = nil, max : Int32 | Nil = nil, search : String | Nil = nil) : Array(Representation::Group) #

Get groups of the given user identified by id

  • brief Boolean which defines whether brief representations are returned
  • first Pagination offset
  • max Maximum results size (defaults to 100)
  • search A String contained in username, first or last name, or email

[View source]
def user_sessions(id : String) : Representation::UserSession #

Get sessions associated with the user

  • id the id of the user

[View source]
def users(*, brief : Bool | Nil = nil, email : String | Nil = nil, email_verified : Bool | Nil = nil, enabled : Bool | Nil = nil, exact : Bool | Nil = nil, first : Int32 | Nil = nil, firstname : String | Nil = nil, idp_alias : String | Nil = nil, idp_user_id : String | Nil = nil, lastname : String | Nil = nil, max : Int32 | Nil = nil, q : String | Nil = nil, search : String | Nil = nil, username : String | Nil = nil, klass = Array(Representation::User)) #

Get users returns a stream of users, filtered according to query parameters.

  • brief Boolean which defines whether brief representations are returned
  • email A String contained in email, or the complete email, if param "exact" is true
  • email_verified whether the email has been verified
  • enabled Boolean representing if user is enabled or not
  • exact Boolean which defines whether the params "last", "first", "email" and "username" must match exactly
  • first Pagination offset
  • firstname A String contained in firstName, or the complete firstName, if param "exact" is true
  • idp_alias The alias of an Identity Provider linked to the user
  • idp_user_id The userId at an Identity Provider linked to the user
  • lastname A String contained in lastName, or the complete lastName, if param "exact" is true
  • max Maximum results size (defaults to 100)
  • q A query to search for custom attributes, in the format 'key1:value2 key2:value2'
  • search A String contained in username, first or last name, or email
  • username A String contained in username, or the complete username, if param "exact" is true

[View source]