Skip to content

Commit ef04642

Browse files
committed
UY-1156 OTP-LDAP documentation
1 parent e617843 commit ef04642

File tree

7 files changed

+71
-5
lines changed

7 files changed

+71
-5
lines changed

documentation/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
<artifactId>unity-server-pam</artifactId>
6666
<version>${project.version}</version>
6767
</dependency>
68+
<dependency>
69+
<groupId>io.imunity</groupId>
70+
<artifactId>unity-server-otp-ldap</artifactId>
71+
<version>${project.version}</version>
72+
</dependency>
6873
<dependency>
6974
<groupId>io.imunity</groupId>
7075
<artifactId>unity-server-web-common</artifactId>
@@ -215,6 +220,7 @@
215220
<argument>pl.edu.icm.unity.webui.authn.extensions.PasswordRetrievalProperties|ref-PasswordRetrievalProperties.txt|</argument>
216221
<argument>pl.edu.icm.unity.webui.authn.extensions.SMSRetrievalProperties|ref-SMSRetrievalProperties.txt|</argument>
217222
<argument>pl.edu.icm.unity.webui.authn.extensions.TLSRetrievalProperties|ref-TLSRetrievalProperties.txt|</argument>
223+
<argument>io.imunity.otp.ldap.OTPWithLDAPProperties|ref-OTPLDAPProperties.txt|</argument>
218224
</arguments>
219225
</configuration>
220226
<goals>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[[otp-ldap-authenticator]]
2+
=== OTP verification with LDAP backend
3+
4+
Credential verificator name:: +otp-ldap+
5+
Compatible credentials:: _not used_
6+
7+
The OTP authenticator with LDAP backend allows for configuring OTP verification with secret (and optionally other OTP parameters) stored in LDAP as user's attribute.
8+
9+
Authenticated user must possess the `username` identity to be authenticated. This identity is mapped to an LDAP entity DN first and then an attribute with OTP secret is retrieved from the entity.
10+
11+
The configuration of this authenticator consists mostly from LDAP connection options.
12+
13+
The most important is setting of an LDAP attribute which is storing an OTP URI with user's secret. The URI must be encoded `otpauth://` scheme. See https://github.com/google/google-authenticator/wiki/Key-Uri-Format for details of the URI format. Additional OTP key parameters as time step, hash algorithm and code length are also taken from the URI if are present. If are missing, then the values set in Unity's configuration of the authenticator are used.
14+
15+
16+
[NOTE]
17+
Technically this authenticator is implemented as _local authenticator_, that is it does not support setting up an input translation profile. This decision was made as in practice OTP is used as a 2nd factor authenticator and if a deployment is using this authenticator, most likely it is accompanied with LDAP password (or certificate) authenticator, which can map and fetch LDAP users with full flexibility of Unity remote authenticator.
18+
19+
20+
==== File based configuration
21+
22+
This section is relevant only if Unity is configured with configuration files, instead of the Admin Console web UI.
23+
24+
Example configuration of LDAP OTP authenticator in unityServer.conf:
25+
26+
----
27+
unityServer.core.authenticators.otpldap.authenticatorName=OTP LDAP
28+
unityServer.core.authenticators.otpldap.authenticatorType=otp-ldap
29+
unityServer.core.authenticators.otpldap.configurationFile=authn/otp-ldap.properties
30+
----
31+
32+
and the corresponding configuration of the authenticator:
33+
34+
----
35+
otpldap.servers.1=localhost
36+
otpldap.ports.1=389
37+
38+
otpldap.userDNTemplate=cn={USERNAME},ou=People,dc=srv,dc=world
39+
otpldap.systemDN=cn=Manager,dc=srv,dc=world
40+
otpldap.systemPassword=ldap-test
41+
42+
otpldap.otpSecretURIAttribute=otp-secret
43+
----
44+
45+
Full reference with all properties:
46+
47+
include::ref-OTPLDAPProperties.txt[]
48+
49+

documentation/src/main/doc/external-idps.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ include::external-saml.txt[]
2323
include::external-oauth.txt[]
2424

2525
include::external-pam.txt[]
26+
27+
include::authenticator-otp-ldap.txt[]

engine-api/src/main/java/pl/edu/icm/unity/engine/api/authn/CredentialVerificator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,8 @@ public enum VerificatorType
2727

2828
/**
2929
* Instance name is the configured name of the authenticator to which this credential verificator belongs.
30-
* @param name
3130
*/
3231
void setInstanceName(String name);
3332

34-
/**
35-
*
36-
* @return verificator type
37-
*/
3833
VerificatorType getType();
3934
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
otpldap.servers.1=localhost
2+
otpldap.ports.1=389
3+
4+
otpldap.userDNTemplate=cn={USERNAME},ou=People,dc=srv,dc=world
5+
otpldap.systemDN=cn=Manager,dc=srv,dc=world
6+
otpldap.systemPassword=ldap-test
7+
8+
otpldap.otpSecretURIAttribute=otp-secret

integration-tests/src/test/resources/unityServer.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ unityServer.core.credentials.3.credentialConfigurationFile=src/test/resources/fi
149149
# Authenticators
150150
#######################################
151151

152+
unityServer.core.authenticators.otpldap.authenticatorName=OTP LDAP
153+
unityServer.core.authenticators.otpldap.authenticatorType=otp-ldap
154+
unityServer.core.authenticators.otpldap.configurationFile=src/test/resources/otp-ldap.properties
155+
152156
unityServer.core.authenticators.1.authenticatorName=pwdSys
153157
unityServer.core.authenticators.1.authenticatorType=password
154158
unityServer.core.authenticators.1.localCredential=sys:password

otp-ldap/src/main/java/io/imunity/otp/ldap/OTPWithLDAPProperties.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import org.apache.logging.log4j.Logger;
1313

14+
import eu.unicore.util.configuration.DocumentationReferenceMeta;
1415
import eu.unicore.util.configuration.DocumentationReferencePrefix;
1516
import eu.unicore.util.configuration.PropertyMD;
1617
import io.imunity.otp.HashFunction;
@@ -40,6 +41,7 @@ class OTPWithLDAPProperties extends LDAPConnectionProperties
4041
@DocumentationReferencePrefix
4142
public static final String PREFIX = "otpldap.";
4243

44+
@DocumentationReferenceMeta
4345
public final static Map<String, PropertyMD> defaults = new HashMap<String, PropertyMD>();
4446

4547
static

0 commit comments

Comments
 (0)