Add Yubikey to User
To add a Yubikey to a user account, use the following request:
POST /users/:user_id/yubi_keys.xml
POST /users/:user_id/yubi_keys.json
XML Request Example
curl -i -X POST -H 'Content-type: application/xml' -u user:userpass http://onapp.test/users/12/yubi_keys.xml -d '<yubi_key><label>1</label><otp>bbhbinoinioniubuyvbioni</otp></yubi_key>'
JSON Request Example
curl -i -X POST -H 'Content-type: application/json' -u user:userpass http://onapp.test/users/12/yubi_keys.json -d '{"yubi_key":{"label":"1", "otp":"hnuibiuiuiuhbyvuytvnlkn"}}'
Where:
label - the YubiKey name, this parameter is optional
otp* - the character string generated by the YubiKey
When you enter the Yubikey, the request is sent automatically.