This section describes the available LoginModules provided by 52°North. They are mainly used by by Web Authentication Service (WAS), Web Security Service (WSS), Authentication Service (AuthN), and Gatekeeper. Of course, they can also be deployed in any other application or web service that wants to make use of them. The specified initialization parameters describe key/value pairs conveyed to a LoginModule throught their initialize(...) method.
Using the org.n52.security.authentication.loginmodule.FileLoginModule class, users and their attributes like name and address are stored in an XML file (schema). The login module authenticates users by checking the provided credentials against the corresponding information specified in this file.
| Parameter | Default | Description |
|---|---|---|
| users.file.path | /users.xml | Path relative to the application's classpath |
| users.cache | false | Specifies whether the user file will be reloaded on every login request |
| credential.isBase64Encoded | false | Defines if the credentials that are provided by the client application, are Base64-encoded and thus have to be Base64-decoded. This is the case if the WAS protocol is used, for example. |
<LoginModule class="org.n52.security.authentication.loginmodule.FileLoginModule" controlFlag="SUFFICIENT"> <Property name="users.file.path" value="/myusers.xml"/> <Property name="users.cache" value="true"/> <Property name="credential.isBase64Encoded" value="true"/> </LoginModule>
<?xml version="1.0" encoding="UTF-8"?>
<UserRepository xmlns="http://www.52north.org/users" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.52north.org/users http://52north.org/schema/users/1.0/users.xsd">
<User username="alice" password="alice" realname="Alice">
<Role name="alice"/>
<Role name="admin"/>
</User>
<User username="bob" password="bob" realname="Bob">
<Role name="bob"/>
<Role name="main"/>
</User>
<User username="guest" password="guest" realname="Guest">
<Role name="guest"/>
</User>
</UserRepository>
!!! Deprecated !!! This LoginModule is not supported in future version. It is quite plain and has some major drawbacks
The DatabaseLoginModule authenticates subjects by means of a JDBC database table. The table must be named Users and must consist of the following fields:
Name, EMail, Password FROM Users WHERE Username
| Field | Type | Description |
|---|---|---|
| USERNAME | String | The unique user's login name |
| PASSWORD | String | unencrypted password |
| String | EMail address of the user, has no meaning in the security system | |
| NAME | String | Intended to be the 'real name' of a user but interpreted as 'role' |
| Parameter | Default | Description |
|---|---|---|
| db.driver.class | /users.xml | JDBC driver class to be used to connect to the database |
| db.url | false | JDBC connection URL |
| db.user | false | Database user who is privilegied to access the database |
| db.password | false | Database user's password |
| credential.isBase64Encoded | false | Defines if the credentials that are provided by the client application, are Base64-encoded and thus have to be Base64-decoded. This is the case if the WAS protocol is used, for example. |
<LoginModule class="org.n52.security.authentication.loginmodule.DataBaseLoginModule" controlFlag="SUFFICIENT"> <Property name="db.driver.class" value="sun.jdbc.odbc.JdbcOdbcDriver"/> <Property name="db.url" value="jdbc:odbc:userDB"/> <Property name="db.user" value="authnService"/> <Property name="db.password" value="pzv3498n"/> <Property name="credential.isBase64Encoded" value="true"/> </LoginModule>
Authenticates users by verifying a delivered Base64-ancoded SAML Response XML element. The module references a WAS instance (by its URL). The WAS URL, name, and accepted authentication methods are, for example, published in the WSS capabilities document. This login module must have access to a Java Keystore file () where the certificate to validate the signed SAML Response is stored.
| Parameter | Default | Description |
|---|---|---|
| validationKeyPair | None | A key pair instance that contains the certificate to validate the SAML ticket. |
| noValidation | false | Set to true if the ticket should not be validated with the certificate. |
| SAMLRoleAttribute | None | ID of the SAML Attribute Assertion that contains the user roles. |
<LoginModule class="org.n52.security.authentication.loginmodule.SAMLTicketLoginModule" controlFlag="SUFFICIENT"> <!-- Reference to PrivatePublicKeyPair defined above --> <Property name="validationKeyPair" idRef="defaultKeyPair"/> <Property name="noValidation" value="false"/> <Property name="SAMLRoleAttributeName" value="urn:n52:authentication:subject:principal:role"/> </LoginModule>
Authenticates user by comparing a defined username and password.
Intended for testing purposes!!!
| Parameter | Default | Description |
|---|---|---|
| allowedUsername | "" | Defines the username accepted by this login module. |
| allowedPassword | "" | Defines the password that must be presented together with the username defined above to successfully authenticate the user. |
| pwdEncAlg | plain | Defines the encryption of the defined password above; one of plain, md5, or sha. |
| userRoles | "" | List of roles that will be assigned to the deifned user; roles are separated by the ' u007C' symbol. |
<LoginModule class="org.n52.security.authentication.loginmodule.SingleUserLoginModule" controlFlag="SUFFICIENT"> <Property name="allowedUsername" value="test"/> <Property name="allowedPassword" value="testpw"/> <Property name="pwdEncAlg" value="plain"/> <Property name="userRoles" value="Alice|admin"/> </LoginModule>