Validate login and create session¶
Summary¶
Source repository:
jef-systems/jef-one-backendSource SHA:
ac65ed21b4ea52235f472efeef826c144a2fe812Source run id:
30028079423Module:
OneLambda function:
jef-one-validate-login-and-create-sessionHTTP method:
POSTInvocation mode:
syncPackage mode:
no-packageAPI category:
One Complex Sync No Package POST APIsAPI path:
/one/complex-sync-no-packages/jef-one-validate-login-and-create-sessionEndpoint URL:
https://api.jefoffice.com/one/complex-sync-no-packages/jef-one-validate-login-and-create-sessionDocumentation scope:
lambda-complex-sync-no-packages
Synchronous Lambda Complex Rule¶
This API is documented as a synchronous Lambda complex no-package API. API Gateway waits for the Lambda result and returns the final Lambda response.
Description¶
Validates login, resolves the effective employee role on the server, and atomically creates or reuses a verified 10-hour session containing a local role snapshot.
Payload Example¶
{
"entity_number": "1000",
"application_name": "jef-one",
"employee_number": "10000",
"password": "pass1234"
}
Payload Schema¶
{
"root": {
"type": "M",
"required": true,
"attributes": {
"session_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$",
"min_length": 36,
"max_length": 36
},
"entity_number": {
"type": "S",
"required": true,
"pattern": "^[0-9]{4}$",
"min_length": 4,
"max_length": 4
},
"application_name": {
"type": "S",
"required": true,
"pattern": "^[A-Za-z0-9 .,'_-]{1,120}$",
"min_length": 1,
"max_length": 120
},
"employee_number": {
"type": "S",
"required": true,
"pattern": "^[0-9]{5}$",
"min_length": 5,
"max_length": 5
},
"password": {
"type": "S",
"required": true,
"min_length": 1,
"max_length": 120,
"write_only": true
},
"role_type": {
"type": "S",
"required": false,
"pattern": "^(user|admin)$",
"enum": [
"user",
"admin"
],
"min_length": 4,
"max_length": 5
}
},
"additional_properties": false
}
}
Response Schema¶
{
"root": {
"type": "M",
"required": true,
"attributes": {
"is_accepted": {
"type": "BOOL",
"required": true
},
"is_valid": {
"type": "BOOL",
"required": true
},
"can_continue": {
"type": "BOOL",
"required": true
},
"session_saved": {
"type": "BOOL",
"required": true
},
"session_active": {
"type": "BOOL",
"required": true
},
"is_active": {
"type": "BOOL",
"required": true
},
"message": {
"type": "S",
"required": true
},
"operation": {
"type": "S",
"required": true
},
"status_code": {
"type": "N",
"required": true,
"integer": true,
"minimum": 100,
"maximum": 599
},
"session_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$"
},
"session_attached_credential_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$"
},
"application_allowed_entity_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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_allowed_employee_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$"
},
"domain_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$"
},
"application_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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}$"
},
"employee_id": {
"type": "S",
"required": false,
"format": "uuid",
"pattern": "^[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": false,
"pattern": "^[0-9]{4}$",
"min_length": 4,
"max_length": 4
},
"application_name": {
"type": "S",
"required": false,
"pattern": "^[A-Za-z0-9 .,'_-]{1,120}$",
"min_length": 1,
"max_length": 120
},
"employee_number": {
"type": "S",
"required": false,
"pattern": "^[0-9]{5}$",
"min_length": 5,
"max_length": 5
},
"role_type": {
"type": "S",
"required": false,
"pattern": "^(user|admin)$",
"enum": [
"user",
"admin"
]
},
"role_name": {
"type": "S",
"required": false,
"pattern": "^[A-Za-z0-9 .,'_-]{1,120}$",
"min_length": 1,
"max_length": 120
},
"role_description": {
"type": "S",
"required": false,
"min_length": 1,
"max_length": 500
},
"display_name": {
"type": "S",
"required": false
},
"main_parent_key_name": {
"type": "S",
"required": false,
"pattern": "^[A-Za-z0-9_-]{1,120}$",
"min_length": 1,
"max_length": 120
},
"main_parent_key_value": {
"type": "S",
"required": false,
"min_length": 1,
"max_length": 255
},
"expires_at": {
"type": "S",
"required": false,
"format": "date-time"
},
"status": {
"type": "S",
"required": false
},
"failure_code": {
"type": "S",
"required": false
},
"failure_reason": {
"type": "S",
"required": false
},
"iat": {
"type": "N",
"required": false,
"integer": true,
"minimum": 0
},
"exp": {
"type": "N",
"required": false,
"integer": true,
"minimum": 0
}
}
}
}
Request Payload¶
{
"entity_number": "1000",
"application_name": "jef-one",
"employee_number": "10000",
"password": "pass1234"
}
CMD curl¶
curl.exe -X POST "https://api.jefoffice.com/one/complex-sync-no-packages/jef-one-validate-login-and-create-session" -H "Content-Type: application/json" --data-raw '{}'
PowerShell curl¶
curl.exe -X POST "https://api.jefoffice.com/one/complex-sync-no-packages/jef-one-validate-login-and-create-session" -H "Content-Type: application/json" --data-raw '{}'