Project

idmclient

0.0
No commit activity in last 3 years
No release in over 3 years
FreeIPA & Red Hat Identity Management (IdM) JSON-RPC API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

FreeIPA & Red Hat Identity Management (IdM) Client

Installation

General

This Gem is published and can be found at https://rubygems.org/gems/idmclient .

To install locally, simply run gem install idmclient.

Cloudforms / ManageIQ

In /var/www/miq/vmdb (you can get there by simply executing vmdb), edit the Gemfile to include a new line:

gem 'idmclient', '~> 0.1.1'

Then update the Gems by executing bundle update. That's it. :)

Examples

Authentication

require 'idmclient'

# Init a connection
idm = IDMClient.new('https://ipa.acme.co/ipa', :debug => true)
# Authentication w/ username + password
idm.authenticate('YOUR_USERNAME', 'YOUR_PASSWORD')

Show user information

# Show an existing user
user = idm.call('user_show', ['my-username'])

Add a new user

# Create a new user
user = idm.call('user_add', ['my-new-user'], {
  :givenname => 'Aaron',
  :sn => 'Aardvark',
  :cn => 'Aaron Aardvark',
  :initials => 'AA',
  :homedirectory => '/home/my-new-user',
  :krbprincipalname => 'my-new-user@ACME.CO',
  :random => true,
  :noprivate => false
})

Add user to a group

# Add an existing user to an existing group
idm.call('group_add_member', ['cool-group'], {:user => 'my-new-user'})

Delete a user

# Delete an existing user
idm.call('user_del', ['my-new-user'])