Login by OTP
- Send an OTP request to get OTP code on you phone:
curl --location --request POST 'localhost:4000/api/v1/auth/login/otp' \
--header 'Content-Type: application/json' \
--data-raw '{
"phone":"{your phone number}"
}'
It will give you a response like this:
{
"code": "shield.user.success_generate_sso",
"data": {
"expire_after": 119,
"expire_at": 1642839900,
"otp_id": "61deb0f763078a7f23b332e9"
}
}
- Send a login request with
otp_idfrom the previous request and otp code which you got on you phone
curl --location --request POST 'localhost:4000/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"password":"{your otp}",
"username":"{your phone number}"
}'
It will give you a response like this:
{
"code": "shield.user.success_login",
"data": {
"token": "f8uz4p2vowp7fyke030q5wrcq5dw14"
}
}
Login by LDAP federation
- Send a login request with your ldap username and password:
curl --location --request POST 'localhost:4000/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"password":"{ldap password}",
"username":"{ldap username}"
}'
It will give you a response like this:
{
"code": "shield.user.success_login",
"data": {
"token": "f8uz4p2vowp7fyke030q5wrcq5dw14"
}
}
Response contains token which you could be used it in other requests.