https://github.com/PhoneX-Security/PhoneX_XMPPServer
Openfire XMPP server, Openfire plugin, push-server, notification server, presence server
https://github.com/PhoneX-Security/PhoneX_XMPPServer
notification-server openfire plugin presence-server push-server xmpp xmpp-server
Last synced: 3 months ago
JSON representation
Openfire XMPP server, Openfire plugin, push-server, notification server, presence server
- Host: GitHub
- URL: https://github.com/PhoneX-Security/PhoneX_XMPPServer
- Owner: PhoneX-Security
- License: gpl-3.0
- Created: 2019-01-06T12:59:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T13:13:27.000Z (over 6 years ago)
- Last Synced: 2024-10-24T15:38:22.558Z (8 months ago)
- Topics: notification-server, openfire, plugin, presence-server, push-server, xmpp, xmpp-server
- Language: Java
- Homepage:
- Size: 24.4 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.html
- Changelog: changelog.html
- License: LICENSE
Awesome Lists containing this project
README
User Service Plugin Readme
BODY {
font-size : 100%;
}
BODY, TD, TH {
font-family : tahoma, verdana, arial, helvetica, sans-serif;
font-size : 0.8em;
}
H2 {
font-size : 10pt;
font-weight : bold;
}
A:hover {
text-decoration : none;
}
H1 {
font-family : tahoma, arial, helvetica, sans-serif;
font-size : 1.4em;
font-weight: bold;
border-bottom : 1px #ccc solid;
padding-bottom : 2px;
}TT {
font-family : courier new;
font-weight : bold;
color : #060;
}
PRE {
font-family : courier new;
font-size : 100%;
}
#datatable TH {
color : #fff;
background-color : #2A448C;
text-align : left;
}
#datatable TD {
background-color : #FAF6EF;
}
#datatable .name {
background-color : #DCE2F5;
}
User Service Plugin ReadmeOverview
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.Installation
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.Configuration
Access to the service is restricted with a "secret" that can be viewed and
set from the User Service page in the Openfire admin console. This page is
located on the admin console under "Server" and then "Server Settings".
This should really only be considered weak security. The plugin was initially written with the assumption that http access to the Openfire service was
only available to trusted machines. In the case of the plugin's author, a web application running on the same server as
Openfire makes the request.Using the Plugin
To administer users, submit HTTP requests to the userservice service.
The service address is [hostname]plugins/userService/userservice. For example,
if your server name is "example.com", the URL is http://example.com/plugins/userService/userserviceThe following parameters can be passed into the request:
NameDescription
typeRequiredThe admin service required.
Possible values are 'add', 'delete', 'update', 'enable', 'disable', 'add_roster', 'update_roster', 'delete_roster'.secretRequired
The secret key that allows access to the User Service.usernameRequired
The username of the user to 'add', 'delete', 'update', 'enable', 'disable', 'add_roster', 'update_roster', 'delete_roster'. ie the part before the @ symbol.passwordRequired for 'add' operation
The password of the new user or the user being updated.nameOptional
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.emailOptional
The email address of the new user or the user being updated.groupsOptional
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_jidRequired for 'add_roster', 'update_roster', 'delete_roster' operations.
The JID of the roster itemsubscriptionOptional
Type of subscription for 'add_roster', 'update_roster' operations. Possible numeric values are: -1(remove), 0(none), 1(to), 2(from), 3(both).Sample HTML
The following example adds a user
http://example.com:9090/plugins/userService/userservice?type=add&secret=bigsecret&username=kafka&password=drowssap&name=franz&[email protected]
The following example adds a user, adds two shared groups (if not existing) and adds the user to both groups.
http://example.com:9090/plugins/userService/userservice?type=add&secret=bigsecret&username=kafka&password=drowssap&name=franz&[email protected]&groups=support,finance
The following example deletes a user and all roster items of the user.
http://example.com:9090/plugins/userService/userservice?type=delete&secret=bigsecret&username=kafka
The following example disables a user (lockout)
http://example.com:9090/plugins/userService/userservice?type=disable&secret=bigsecret&username=kafka
The following example enables a user (removes lockout)
http://example.com:9090/plugins/userService/userservice?type=enable&secret=bigsecret&username=kafka
The following example updates a user
http://example.com:9090/plugins/userService/userservice?type=update&secret=bigsecret&username=kafka&password=drowssap&name=franz&[email protected]
The following example adds new roster item with subscription 'both' for user 'kafka'
http://example.com:9090/plugins/userService/userservice?type=add_roster&secret=bigsecret&username=kafka&[email protected]&name=franz&subscription=3
The following example adds new roster item with subscription 'both' for user 'kafka' and adds kafka to roster groups 'family' and 'friends'
http://example.com:9090/plugins/userService/userservice?type=add_roster&secret=bigsecret&username=kafka&[email protected]&name=franz&subscription=3&groups=family,friends
The following example updates existing roster item to subscription 'none' for user 'kafka'
http://example.com:9090/plugins/userService/userservice?type=update_roster&secret=bigsecret&username=kafka&[email protected]&name=franz&subscription=0
The following example deletes a specific roster item '[email protected]' for user 'kafka'
http://example.com:9090/plugins/userService/userservice?type=delete_roster&secret=bigsecret&username=kafka&[email protected]
* When sending double characters (Chinese/Japanese/Korean etc) you should URLEncode the string as utf8.
In Java this is done like this
URLEncoder.encode(username, "UTF-8"));
If the strings are encoded incorrectly, double byte characters will look garbeled in the Admin Console.Server Reply
The server will reply to all User Service requests with an XML result page.
If the request was processed successfully the return will be a "result" element with a text body of "OK".
If the request was unsuccessful, the return will be an "error" element with a text body of one of the following error strings.Error StringDescription
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.