The htpasswd plugin uses an encrypted password file to authenticate a user and to determine whether the user is a member of any group that is permitted to access a particular resource.
As with any plugin, you must update the c8-server.conf configuration file to specify information about the plugin. Below is an excerpt from the default c8-server.conf file, which shows the preferences used by the htpasswd plugin, which has the 4 standard preferences (LibraryName, InitializeFunction, AuthenticateFunction, and ShutdownFunction) and 2 custom preferences (PasswordFilePath and GroupFilePath).
<section name="Plugin"> <preference name="LibraryName" value="c8_server_plugins_lib"/> <preference name="InitializeFunction" value="c8_auth_plugin_htpasswd_initialize"/> <preference name="AuthenticateFunction" value="c8_auth_plugin_htpasswd_authenticate"/> <preference name="ShutdownFunction" value="c8_auth_plugin_htpasswd_shutdown"/> <preference name="PasswordFilePath" value="C:\Program Files\SybaseC8\Server/conf/htpasswd.txt"/> <preference name="GroupFilePath" value="C:\Program Files\SybaseC8\Server/conf/htgroup.txt"/> </section>
The initialize and shutdown functions perform just as described in Plugins.
The AuthenticateFunction corresponds to the execute() function described in Plugins; this function is called each time a user gives her username and password in order to access a resource, such as a stream.
This custom entry PasswordFilePath contains pairs of usernames and passwords that the plugin uses to determine whether a user is who he or she claims to be.
Finally, the custom entry GroupFilePath lists the groups that each user is in. This is used when the ACL file permits or denies privileges to particular groups.
For example, suppose that you have multiple people who are system administrators, and we want to create a group named "SysAdmins" and allow any member of that group to create or destroy workspaces. To do this, perform the following actions: