The Encap Authenticator has an optional flow which can be used when the app requesting authentication is also the app that implements the encap-client using the encap SDK.
In this scenario it is no longer needed to have any user interaction when activating the device. The user only has to authenticate using some other means of authentication, before activating the device. The activation code can then automatically be passed to the app and the app can finalize the activation.
Fig. 179 Encap - Non interactive flow
The endpoints to be interacted with are located under the Authentication service’s anonymous endpoint. The following sub-paths are used
Start activate requires a verifier to be sent on the query string. This is a random string that the app should generate before starting activation. The purpose is that if another app hijacks the return redirect it cannot use the activation code to activate the device with Curity since it does not know the verifier.
verifier
Example start-auto-activate
Request:
GET /authn/anonymous/encap1/start-auto-activate?verifier=DMCA12-BBDK442-j4mm22763 HTTP/1.1 Host: login.example.com
Response:
HTTP/1.1 302 Found Location: myapp://activate?activationCode=95524851&activationToken=3E2GiWTU7oY9PdjNWsrxsQB2vTfAR3l8&finishActivationUrl=https%3A%2F%login.example.com%3A8443%2Fdev%2Fauthn%2Fanonymous%2Fencap1%2Ffinish-auto-activate
In the redirect back to the app the following parameters are found on the query string.
The finish-auto-activate endpoint is given in the finishActivationUrl above. It is a JSON endpoint and takes a POST request with a body of the following parameters.
finishActivationUrl
phone
tablet
other
2017-02-02T11:07:00.00Z
Example
POST /authn/anonymous/encap1/finish-auto-activate HTTP/1.1 Host: login.example.com Content-Type: application/json Accept: application/json { "activationToken" : "3E2GiWTU7oY9PdjNWsrxsQB2vTfAR3l8", "verifier" : "DMCA12-BBDK442-j4mm22763", "alias" : "Compay ABC App", "formFactor" : "phone", "phoneNumber" : "+467012345678", "deviceExpiresAt" : "2020-02-02T12:00:00.00Z" }
HTTP/1.1 200 OK Content-Type: application/json {}
Example without optional parameters
POST /authn/anonymous/encap1/finish-auto-activate HTTP/1.1 Host: login.example.com Content-Type: application/json Accept: application/json { "activationToken" : "3E2GiWTU7oY9PdjNWsrxsQB2vTfAR3l8", "verifier" : "DMCA12-BBDK442-j4mm22763" }