General Information
Service | API | Method |
---|---|---|
urac | /login | POST |
Data Model: Users
Input
Name | Source | Mandatory | Type | Special Format | Descrition |
---|---|---|---|---|---|
username | Body | YES | String | N/A | username or email |
password | Body | YES | String | N/A |
Output
Valid Response
Valid Response from Login API
{ "result": true, "data": { "_id": "57063608622c47b5c097d19b", "locked": true, "username": "owner", "firstName": "owner", "lastName": "owner", "email": "owner@soajs.org", "ts": 1460024840683, "status": "active", "profile": {}, "groups": ["owner"], "config": {}, "tenant": { "id": "5551aca9e179c39b760f7a1a", "code": "DBTN" }, "groupsConfig": [{ "_id": "57063608622c47b5c097d19d", "locked": true, "code": "owner", "name": "Owner Group", "description": "this is the owner group that owns the dashboard", "tenant ": { "id ": "5551aca9e179c39b760f7a1a", "code ": "DBTN" } }] }, "soajsauth": "Basic c29hanM6QzAyMzcybVZla3AybWdjODNxNHJOSnQ3QVJkVktlNmdMd0U=" }
Invalid Response
Error Response from Login API
{ "result":false, "errors":{ "codes":[400], "details":[ { "code":400, "message":"Problem with the provided password" } ] } }
Error Codes
Code | Description |
---|---|
400 | Problem with the provided password |
401 | Unable to log in the user. User not found. |
Example (CURL)
Request
Calling Login API
> CURL -X POST http://127.0.0.1:4000/urac/login -d 'username=john&password=johnpassword'
Response
Login API response
{ "result": true, "data": { "_id": "57063608622c47b5c097d19b", "locked": true, "username": "john", "firstName": "John", "lastName": "Doe", "email": "john@domain.com", "ts": 1460024840683, "status": "active", "profile": {}, "groups": ["administrator"], "config": {}, "tenant": { "id": "4442aca8e268c28b650f6a2a", "code": "TEST" }, "groupsConfig": [{ "_id": "55ffbb4bc92cb880753f8d3e", "locked": true, "code": "administrator", "name": "Administrator", "description": "Administrator Group for tenant Test", "tenant ": { "id ": "4442aca8e268c28b650f6a2a", "code ": "TEST" } }] }, "soajsauth": "Basic c29hanM6QzAxNkh5YXdPclhESVkxeU1makJyYV85OHdza2k5bWVDRTY=" }
Add Comment