Validate login and create session¶
Summary¶
Source repository:
jef-systems/jef-one-backendSource SHA:
fc63b90deba131d1510b6789c172b240e305d07cSource run id:
26362659871Module:
OneLambda function:
jef-one-validate-login-and-create-sessionHTTP method:
POSTInvocation mode:
asyncPackage mode:
no-packageAPI category:
One Complex No Package Async POST APIsAPI path:
/jef-one-validate-login-and-create-sessionEndpoint URL:
https://mfr670zvsh.execute-api.ap-southeast-1.amazonaws.com/prod/jef-one-validate-login-and-create-sessionDocumentation scope:
lambda-complex-no-packages
Async Confirmation Rule¶
This write API is documented as an async accepted request, not final write success. Use the corresponding GET API to confirm the final state.
Description¶
Accepts a frontend-generated session_id, records a processing session first, then asynchronously validates login and updates the same session to verified or failed. It can repair missing application_id/entity_id on an existing application credential by resolving the linked application/entity records.
API Gateway Response¶
{
"status_code": 202,
"message": "This endpoint returns 202 when the request is accepted. The Lambda function continues processing asynchronously."
}
Payload Example¶
{
"session_id": "8d4e7d32-2f6f-4d13-9b8e-0f4e98ef0001",
"entity_number": "1000",
"application_name": "value_00",
"employee_number": "10000",
"password": "JefTest-10000-Q7mR"
}
Payload Schema¶
{
"root": {
"type": "M",
"required": true,
"attributes": {
"session_id": {
"type": "S",
"required": true,
"regex": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
},
"entity_number": {
"type": "S",
"required": true,
"regex": "^[0-9]{4}$"
},
"application_name": {
"type": "S",
"required": true,
"regex": "^[A-Za-z0-9 .,'_-]{1,120}$"
},
"employee_number": {
"type": "S",
"required": true,
"regex": "^[0-9]{5}$"
},
"password": {
"type": "S",
"required": true,
"regex": "^.{1,120}$"
}
}
}
}
Response Schema¶
{
"root": {
"type": "M",
"required": true,
"attributes": {
"is_accepted": {
"type": "BOOL",
"required": true
},
"is_valid": {
"type": "BOOL",
"required": true
},
"session_saved": {
"type": "BOOL",
"required": true
},
"message": {
"type": "S",
"required": true
},
"operation": {
"type": "S",
"required": true
},
"status_code": {
"type": "N",
"required": true
},
"entity_number": {
"type": "S",
"required": false
},
"application_name": {
"type": "S",
"required": false
},
"employee_number": {
"type": "S",
"required": false
},
"application_credential_id": {
"type": "S",
"required": false
},
"application_id": {
"type": "S",
"required": false
},
"employee_id": {
"type": "S",
"required": false
},
"entity_id": {
"type": "S",
"required": false
},
"entity_credential_id": {
"type": "S",
"required": false
},
"display_name": {
"type": "S",
"required": false
},
"session_id": {
"type": "S",
"required": false
},
"status": {
"type": "S",
"required": false
},
"expires_at": {
"type": "S",
"required": false
},
"failure_code": {
"type": "S",
"required": false
},
"failure_reason": {
"type": "S",
"required": false
}
}
}
}
Request Payload¶
{
"session_id": "8d4e7d32-2f6f-4d13-9b8e-0f4e98ef0001",
"entity_number": "1000",
"application_name": "value_00",
"employee_number": "10000",
"password": "JefTest-10000-Q7mR"
}
CMD curl¶
curl -X POST "https://mfr670zvsh.execute-api.ap-southeast-1.amazonaws.com/prod/jef-one-validate-login-and-create-session" \
-H "Content-Type: application/json" \
--data-raw '{"session_id":"8d4e7d32-2f6f-4d13-9b8e-0f4e98ef0001","entity_number":"1000","application_name":"value_00","employee_number":"10000","password":"JefTest-10000-Q7mR"}'
PowerShell curl¶
curl.exe -X POST "https://mfr670zvsh.execute-api.ap-southeast-1.amazonaws.com/prod/jef-one-validate-login-and-create-session" `
-H "Content-Type: application/json" `
--data-raw '{"session_id":"8d4e7d32-2f6f-4d13-9b8e-0f4e98ef0001","entity_number":"1000","application_name":"value_00","employee_number":"10000","password":"JefTest-10000-Q7mR"}'