Appearance
Authentication request by email address
A simple request to authenticate a user by its email address can be found below:
Simple
bash
curl -X POST https://api.quantauth.app/v1/authentication-request/ \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "application_title": "My App"}'
Parameters
email
: The email address of the user to authenticate.application_title
: The title of your application, so that the user knows where the request is coming from.authentication_request_id
(optional): An uuid identifying the authentication request. Initially you can either provide your own, or (if you don't provide one) let the server automatically generate one for you. The response will contain your (or the automatically generated) id that you then can use in subsequent requests to check the authentication request was approved or denied by the user.wait_for_response
(optional): Specify how long to wait for the response. (Default900
for 15 min)user_name
(optional): The name or the email address of the user that authenticates. This information will be shown to the user, allowing him to evaluate whether to allow or deny the request.user_ip
(optional): The IPv4 or IPv6 of the user that authenticates. This information will be shown to the user, allowing him to evaluate whether to allow or deny the request.user_origin
(optional): A meaningful description of the origin e.g. the city or the state. This information will be shown to the user, allowing him to evaluate whether to allow or deny the request.
Response
- 200
Will be returned when the configuration timeout is reached or the user approved / denied the request. (Default timeout 15 min, can be influenced by wait_for_response
)
json
{
"authentication_request_id": "ec552536-4f66-45d1-bcd6-1c3a7f17f269",
"authentication_request_status": "pending",
"authentication_request_response": null
}
Other examples
- Avoid long-running requests and return immediately a response.
bash
curl -X POST https://api.quantauth.app/v1/authentication-request/ \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "application_title": "My App", "wait_for_response": 0}'
You will immediately receive
- 200 - OK
json
{
"authentication_request_id": "ec552536-4f66-45d1-bcd6-1c3a7f17f269",
"authentication_request_status": "pending",
"authentication_request_response": null
}
And then can use the authentication_request_id
from the response to check the status of that specific authentication request later recurring.
bash
curl -X POST https://api.quantauth.app/v1/authentication-request/ \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "application_title": "My App", "wait_for_response": 0, "authentication_request_id": "ec552536-4f66-45d1-bcd6-1c3a7f17f269"}'
An authentication request is always valid for 15 minutes, so if the user didn't sign in within that timeframe you can stop pulling.
- With authentication header to increase the rate limit
bash
curl -X POST https://api.quantauth.app/v1/authentication-request/ \
-H "Content-Type: application/json" \
-H "Authorization: Token {API_KEY}" \
-d '{"email": "test@example.com", "application_title": "My App"}'