‘enroll’

/api/v1/enroll

/api/v1/enroll/{enroll_process_id:[a-zA-Z0-9]+}*custom_method

The service for creation authentication template (enroll). Requires login_session_id. Any user may start enroll process.

When process is finished, you create template from process result by using ‘user_template’ service. Until that, process result lives at the server for some time. Admin may assign process result to any user. User may assign process result to himself. It is possible that user1 created the process, tell enroll_process_id to user2 and he assigns it to himself.

Enroll procedure:

  1. Start enroll process, grab enroll_process_id
  2. Series of do_enroll calls. Client software sends ‘response’ to server until it replies ‘OK’ or ‘FAILED’
  3. POST/PUT enroll_process_id and user_id to ‘user_templates’ service.

POST

Start enroll process:

POST /api/v1/enroll
{
    'method_id': 'HOTP:1'  # login method to create authentication template for
}
Returns
{
    'enroll_process_id': 'fgh890'
}

Grab enroll_process_id and perform series of do_enroll calls while getting status ‘MORE_DATA’:

POST /api/v1/enroll/fgh890/do_enroll
{
    'response': 'method-specific data, maybe nested dict'
}
Returns
{
    'status': 'MORE_DATA/OK/FAILED',
    'msg': 'some useful message, use for debug. You may show msg to user in case of failure',
    'method_id': 'method being enrolled, use for debug'
}

When you get ‘status’=’OK’, enroll process is finished. Now you want to create template from process result and link it to a user. POST/PUT enroll_process_id and user_id to ‘user_templates’ service. It will create authentication template and destroy waiting enroll process. User will become template owner.

DELETE

Destroy pending/waiting process:

DELETE /api/v1/enroll/fgh890