Passwordless sign-in in three calls
· 4 min read
The login page needs a code to show, and the server needs to learn who approved it. That is two things, and Qravix gives you both with three calls.
1. Ask for a sign-in
Your server calls Qravix with its API key. The answer is a link for the QR code and an id. Give it the name of your app and a short context such as the browser and city; the phone shows them, so a person can spot a request they did not start.
2. Show the code and wait
Show the link as a QR code. The person scans it with the Qravix phone, sees your app’s name, and approves. The approval is signed with the key on the phone.
3. Collect the answer
Your server asks for the result once. If it was approved, you get your own reference for that person, such as a user id, and you start your session. The answer is handed over once and the request is marked used.
If you already speak OpenID Connect, you can skip all of this and point your library at your project’s discovery address.
curl -X POST $QRAVIX/v1/logins -H "Authorization: Bearer $KEY" \
-d '{ "app_name": "Acme Shop", "context": "Chrome, Berlin" }'
curl $QRAVIX/v1/logins/$ID -H "Authorization: Bearer $KEY"