This project is a plugin for the [Openfire Realtime Collaboration Server](http://www.igniterealtime.org/projects/openfire/).
This plugin adds a SASL mechanism that allows users to authenticate against a token that is generated by an instance of [Tiki Wiki CMS GroupWare](https://tiki.org/).
## Building the source
To create an Openfire plugin from the source code in this project:
- Download a copy of the sources of this project into `PLUGINDIR`
- Download a copy of the [Openfire sources](https://github.com/igniterealtime/Openfire) into `OPENFIRE_SOURCE_DIR`
- From within `OPENFIRE_SOURCE_DIR` execute: `ant -f build/build.xml -Dplugin.src.dir=PLUGINDIR/.. -Dplugin=tikitoken openfire plugin`
## Installing the plugin
After a plugin JAR file has been created, place that file in the plugin directory of a running Openfire instance.
Openfire will automatically detect and activate the plugin.
More detailed usage instructions are available in the [readme](readme.html) file that is available as part of the source
thrownewSaslException("Exactly two NUL (U+0000) character-separated values are expected (a username, followed by a Tiki access token). Instead "+tokens.countTokens()+" were found.");
}
finalStringusername=tokens.nextToken();
finalStringtikiToken=tokens.nextToken();
Log.trace("Parsed data from client response for user '{}'. Verifying Tiki token...",username);
thrownewSaslException("Tiki token based authentication failed for: "+username);
}
Log.debug("Authentication successful for user '{}'!",username);
authorizationID=username;
returnnull;
}
default:
thrownewIllegalStateException("Instance is in an unrecognized state (please report this incident as a bug in class: "+this.getClass().getCanonicalName()+"). Unrecognized value: "+state);
}
}
publicbooleanisComplete()
{
returnstate==State.COMPLETED;
}
publicStringgetAuthorizationID()
{
if(!isComplete())
{
thrownewIllegalStateException("TIKITOKEN authentication has not completed.");
}
returnauthorizationID;
}
publicObjectgetNegotiatedProperty(StringpropName)
{
if(!isComplete())
{
thrownewIllegalStateException("TIKITOKEN authentication has not completed.");