looorent / keycloak-admin-ruby Goto Github PK
View Code? Open in Web Editor NEWKeycloak Admin REST API client written in Ruby
License: MIT License
Keycloak Admin REST API client written in Ruby
License: MIT License
I just checked out the gem and found out that the group representation is missing the subGroups. Are there any plans to implement that?
Hey there,
I know that the gem doesn't support validating TOTP's, but would you @looorent consider this useful functionality?
We're planning to implement TOTP checks for dangerous operations in our app, and it would be great if we could simply do something along the lines as below within our app:
kc_user = KeycloakAdmin.realm("my_realm").users.get(current_user.keycloak_id)
otp_ok = kc_user.totp_ok?(params[:totp]) # => true or false, depending...
Would you see this as a valuable feature to add? If so, we would like potentially issue a PR?
I started seeing this error in the latest keycloak upgrade from 0.7.5 to 0.7.6
Keycloak: The request failed with response code 400 and message: Unrecognized field "client_role" (class org.keycloak.representations.idm.RoleRepresentation), not marked as ignorable (RuntimeError)
Here is the code
user = KeycloakAdmin.realm('Neebo').users.create!(username, email, pw, email_verified, locale)
KeycloakAdmin.realm('Neebo').users.update(user.id, {
firstName: username.split('_').last.capitalize,
lastName: Faker::Name.last_name.capitalize
})
available_client_roles = KeycloakAdmin.realm('Neebo').user(user.id).client_role_mappings(client[0].id).list_available
client_roles = available_client_roles.select {|role| role.name == 'view-users'}
KeycloakAdmin.realm('Neebo').user(user.id).client_role_mappings(client[0].id).save(client_roles)
The error is thrown on the last line here ^^
Any suggestions?
Keycloak 21.x
Code:
update_name = Hash.new
update_name.merge!({firstName: firstname}) if firstname && firstname.length > 0
update_name.merge!({lastName: lastname}) if lastname && lastname.length > 0
begin
user = KeycloakAdmin.realm("haiku").users.search(email).first
puts("found #{user.id} to update with...")
pp update_name
pp KeycloakAdmin.realm("haiku").users.update(user.id, update_name)
rescue RuntimeError => error
puts "FAIL - Unable to add #{username} - #{error}"
next
end
Result:
found facd73a6-f66f-45bb-b274-XXXXXXXXXX to update with...
{:firstName=>"waddlesplash", :lastName=>"waddlesplash"}
true
The keycloak setup documentation is pretty scarce around client setup:
The terminology doesn't seem consistent between the ruby gem and keycloak.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.