The User Service Plugin provides the ability to add,edit,delete users and manage their rosters by sending an http request to the server. It is intended to be used by applications automating the user administration process. This plugin's functionality is useful for applications that need to administer users outside of the Openfire admin console. An example of such an application might be a live sports reporting application that uses XMPP as its transport, and creates/deletes users according to the receipt, or non receipt, of a subscription fee.
Copy userservice.jar into the plugins directory of your Openfire server. The plugin will then be automatically deployed. To upgrade to a new version, copy the new userservice.jar file over the existing file.
The following parameters can be passed into the request:
|type||Required||The admin service required. Possible values are 'add', 'delete', 'update', 'enable', 'disable', 'add_roster', 'update_roster', 'delete_roster'.|
|secret||Required||The secret key that allows access to the User Service.|
|username||Required||The username of the user to 'add', 'delete', 'update', 'enable', 'disable', 'add_roster', 'update_roster', 'delete_roster'. ie the part before the @ symbol.|
|password||Required for 'add' operation||The password of the new user or the user being updated.|
|name||Optional||The display name of the new user or the user being updated. For 'add_roster', 'update_roster' operations specifies the nickname of the roster item.|
|Optional||The email address of the new user or the user being updated.|
List of groups where the user is a member. Values are comma delimited. When used with types "add" or "update", it adds the user to shared groups and auto-creates new groups.
When used with 'add_roster' and 'update_roster', it adds the user to roster groups provided the group name does not clash with an existing shared group.
|item_jid||Required for 'add_roster', 'update_roster', 'delete_roster' operations.||The JID of the roster item|
|subscription||Optional||Type of subscription for 'add_roster', 'update_roster' operations. Possible numeric values are: -1(remove), 0(none), 1(to), 2(from), 3(both).|
The following example adds a user
|IllegalArgumentException||one of the parameters passed in to the User Service was bad.|
|UserNotFoundException||No user of the name specified, for a delete or update operation, exists on this server. For 'update_roster' operation, roster item to be updated was not found.|
|UserAlreadyExistsException||A user with the same name as the user about to be added, already exists. For 'add_roster' operation, roster item with the same JID already exists.|
|RequestNotAuthorised||The supplied secret does not match the secret specified in the Admin Console or the requester is not a valid IP address.|
|UserServiceDisabled||The User Service is currently set to disabled in the Admin Console.|
|SharedGroupException||Roster item can not be added/deleted to/from a shared group for operations with roster.|