| 1 |
Yubico OTP Second Factor |
| 2 |
======================== |
| 3 |
|
| 4 |
Yubico OTP is a type of One-Time-Password authentication based on a |
| 5 |
keyboard-emulating hardware device (Yubikey). OTPs are validated against an |
| 6 |
external server, either on the cloud or on premices. |
| 7 |
|
| 8 |
|deprecated| Almost all Yubikeys sold by Yubico now support :doc:`FIDO2 <webauthn2f>`. |
| 9 |
You are encouraged to use this type of second factor instead, since it is |
| 10 |
compatible with a much broader range of devices, and also more secure. |
| 11 |
|
| 12 |
Prerequisites and dependencies |
| 13 |
------------------------------ |
| 14 |
|
| 15 |
You must install |
| 16 |
`Auth::Yubikey_WebClient <http://search.cpan.org/~massyn/Auth-Yubikey_WebClient/>`__ |
| 17 |
package. |
| 18 |
|
| 19 |
You have to retrieve a client ID and a secret key from Yubico. See |
| 20 |
`Yubico API <https://upgrade.yubico.com/getapikey/>`__ page. |
| 21 |
|
| 22 |
Configuration |
| 23 |
------------- |
| 24 |
|
| 25 |
In the manager (second factors), you just have to enable it: |
| 26 |
|
| 27 |
- **Activation**: set it to "on" |
| 28 |
- **Self registration**: set it to "on" if users are authorized to |
| 29 |
register their keys |
| 30 |
- **Allow users to remove Yubikey**: If enabled, users can unregister |
| 31 |
Yubikey device. |
| 32 |
- **API client ID**: given by Yubico or another service |
| 33 |
- **API secret key**: given by Yubico or another service |
| 34 |
- **Nonce** (optional): if any |
| 35 |
- **Service URL**: service URL (leave it blank to use Yubico cloud services) |
| 36 |
- **OTP public ID part size**: leave it to default (12) unless you know |
| 37 |
what you are doing |
| 38 |
- **Get Yubikey ID from session attribute**: if non-empty, the Yubikey ID will |
| 39 |
be read from this session attribute. This allows external provisionning of Yubikeys. |
| 40 |
- **Authentication level**: you can overwrite here auth level for |
| 41 |
Yubikey registered users. Leave it blank keeps auth level provided by |
| 42 |
first authentication module *(default: 2 for user/password based |
| 43 |
modules)*. **It is recommended to set an higher value here if you |
| 44 |
want to give access to some apps only for enrolled users** |
| 45 |
- **Label** (Optional): label that should be displayed to the user on |
| 46 |
the choice screen |
| 47 |
- **Logo** (Optional): logo file *(in static/<skin> directory)* |
| 48 |
- **Lifetime** (Optional): Unlimited by default. Set a Time To Live in seconds. |
| 49 |
TTL is checked at each login process if set. If TTL is expired, |
| 50 |
relative Yubikey is removed. |
| 51 |
|
| 52 |
|
| 53 |
.. attention:: |
| 54 |
If you want to use a custom rule for "activation" and want to keep self-registration, |
| 55 |
you must add the following condition to the custom activation rule:: |
| 56 |
|
| 57 |
and has2f('UBK') |
| 58 |
|
| 59 |
Without this condition, Yubico OTP will be asked even for users who didn't register one. |
| 60 |
This is automatically done when "activation" is simply set to "on". |
| 61 |
|
| 62 |
|
| 63 |
Provisioning |
| 64 |
------------ |
| 65 |
|
| 66 |
If you don't want to use self-registration, set public part of user's |
| 67 |
yubikey in Second Factor Devices array (JSON) in your user-database. |
| 68 |
Then map it to the \_2fDevices attribute (see |
| 69 |
:doc:`exported variables<exportedvars>`): |
| 70 |
|
| 71 |
.. code:: |
| 72 |
|
| 73 |
[{"name" : "MyYubikey" , "type" : "UBK" , "_secret" : "########" , "epoch":"1524078936"}, ...] |
| 74 |
|
| 75 |
Enrollment |
| 76 |
---------- |
| 77 |
|
| 78 |
If you have enabled self registration, users can register their U2F keys |
| 79 |
using https://portal/2fregisters |
| 80 |
|
| 81 |
.. |deprecated| image:: /documentation/deprecated.png |