Last updated

Authentication with an enrolled device

DEVICE login is designed for authentication by a pre-enrolled device or a device that can register itself with a unique ID.

This mechanism does not prescribe the identifier or format to be used. For example, it may be an IMEI, an Android device ID, a machine ID, or a custom identifier.

Configuration

Be sure to configure the Catena platform auth service when using this validator.

The ConnectionString used by the DEVICE validator must match the ConnectionString used by the Catena platform auth service to enroll devices and authenticate.

To use the device provider with the Catena authentication service, make sure it is enabled in the configuration and the database ConnectionString is configured.

{
  "Catena": {
    "Authentication": {
      "PROVIDER_DEVICE": {
        "ConnectionString": "Data Source=Build/SqliteDatabase/email_sign_up.db;Foreign Keys=True",
        "IsEnabled": true
      }
    }
  }
}

Usage

To authenticate using a device, specify PROVIDER_DEVICE in your authentication request and provide the device identifier and its token/certificate separated by a colon as the payload.

For example, c70044a8-4723-4060-ae4c-c2a03f385bd8:OTM2YmVhZWEtODk3Yi00N2YwLWFjMjgtNDQ3ODRjMTQwMzNhCg== would be the payload for a device c70044a8-4723-4060-ae4c-c2a03f385bd8 which was enrolled previously and received the token OTM2YmVhZWEtODk3Yi00N2YwLWFjMjgtNDQ3ODRjMTQwMzNhCg==.

Refer to the following code samples.

Note: A successful authentication request will return an empty response body. The catena-session-id response header is what we're looking for here.

Code Sample

curl -i -X POST \
  http://localhost:5000/api/v1/authentication/login \
  -H 'Content-Type: application/json' \
  -d '{
    "provider": "PROVIDER_DEVICE",
    "payload": "c70044a8-4723-4060-ae4c-c2a03f385bd8:OTM2YmVhZWEtODk3Yi00N2YwLWFjMjgtNDQ3ODRjMTQwMzNhCg=="
  }'
Response
application/json
{ "redirectUri": "string" }

Send Request from This Page

Loading...