Submit password credentials to a login flow
Submit password credentials to a login flow
curl --request POST \
--url https://api-gw.verolabs.co/api/authen/self-service/login \
--header 'Content-Type: application/json' \
--data '
{
"method": "password",
"csrf_token": "<string>",
"password_identifier": "jsmith@example.com",
"password": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'password',
csrf_token: '<string>',
password_identifier: 'jsmith@example.com',
password: '<string>'
})
};
fetch('https://api-gw.verolabs.co/api/authen/self-service/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-gw.verolabs.co/api/authen/self-service/login"
payload = {
"method": "password",
"csrf_token": "<string>",
"password_identifier": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-gw.verolabs.co/api/authen/self-service/login"
payload := strings.NewReader("{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-gw.verolabs.co/api/authen/self-service/login");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);falseCURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-gw.verolabs.co/api/authen/self-service/login");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}");
CURLcode ret = curl_easy_perform(hnd);{
"session_token": "<string>",
"session": {
"id": "<string>",
"active": true,
"identity": {
"id": "<string>",
"traits": {},
"schema_id": "<string>",
"schema_url": "<string>",
"state": "<string>",
"state_changed_at": "2023-11-07T05:31:56Z",
"recovery_addresses": [
{}
],
"metadata_public": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>"
},
"tokenized": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"authenticated_at": "2023-11-07T05:31:56Z",
"authenticator_assurance_level": "<string>",
"authentication_methods": [
{
"method": "<string>",
"aal": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"issued_at": "2023-11-07T05:31:56Z",
"devices": [
{
"id": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"location": "<string>"
}
]
},
"identity": {}
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}Query Parameters
Flow identifier returned by the matching create-flow endpoint. Submit/update requests must use the same flow id.
Body
self-service flow update payload. Pass the flow id in the query string and include the fields required by the selected method.
JSON payload used to submit password credentials to an login flow.
Authentication method. The mobile/web client submits password for password login.
password CSRF token copied from the login flow UI node when required.
User login identifier. The app sends the account email address.
Plain-text password entered by the user. Send only over HTTPS.
Response
Successful login flow response. The app reads session_token from this payload and uses it as the authenticated session token.
Response returned after a successful API login flow.
Bearer/session token used by the client for authenticated API calls.
session object for the authenticated identity.
Hide child attributes
Hide child attributes
session id.
Whether the session is currently active.
Authenticated identity object, including id, schema metadata, state, traits, recovery addresses, and timestamps.
Hide child attributes
Hide child attributes
identity id for the authenticated user.
Identity profile attributes stored by, such as email and name.
identity schema id.
URL of the identity schema.
identity state, for example active.
Timestamp when the identity state last changed.
Recovery addresses configured on the identity.
Public identity metadata returned by the system; can be null.
Identity creation timestamp.
Identity update timestamp.
organization id when the identity belongs to an organization; null otherwise.
Bearer token returned when tokenize_as is supplied and returns a tokenized session.
Timestamp when the session expires.
Timestamp when the user authenticated for this session.
authenticator assurance level for the session, for example aal1.
Authentication methods completed for the session.
Timestamp when issued the session.
Device/session metadata returned by the system, including device id, IP address, user agent, and location.
identity object. Includes identity id and traits when returned by the system.
curl --request POST \
--url https://api-gw.verolabs.co/api/authen/self-service/login \
--header 'Content-Type: application/json' \
--data '
{
"method": "password",
"csrf_token": "<string>",
"password_identifier": "jsmith@example.com",
"password": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'password',
csrf_token: '<string>',
password_identifier: 'jsmith@example.com',
password: '<string>'
})
};
fetch('https://api-gw.verolabs.co/api/authen/self-service/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-gw.verolabs.co/api/authen/self-service/login"
payload = {
"method": "password",
"csrf_token": "<string>",
"password_identifier": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-gw.verolabs.co/api/authen/self-service/login"
payload := strings.NewReader("{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-gw.verolabs.co/api/authen/self-service/login");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);falseCURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-gw.verolabs.co/api/authen/self-service/login");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"method\": \"password\",\n \"csrf_token\": \"<string>\",\n \"password_identifier\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}");
CURLcode ret = curl_easy_perform(hnd);{
"session_token": "<string>",
"session": {
"id": "<string>",
"active": true,
"identity": {
"id": "<string>",
"traits": {},
"schema_id": "<string>",
"schema_url": "<string>",
"state": "<string>",
"state_changed_at": "2023-11-07T05:31:56Z",
"recovery_addresses": [
{}
],
"metadata_public": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>"
},
"tokenized": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"authenticated_at": "2023-11-07T05:31:56Z",
"authenticator_assurance_level": "<string>",
"authentication_methods": [
{
"method": "<string>",
"aal": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"issued_at": "2023-11-07T05:31:56Z",
"devices": [
{
"id": "<string>",
"ip_address": "<string>",
"user_agent": "<string>",
"location": "<string>"
}
]
},
"identity": {}
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}
