Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General Information

...

ServiceAPIMethod
urac/loginPOST

Data Model: Users

Input

NameSourceMandatoryTypeSpecial FormatDescrition
usernameBodyYESStringN/Ausername or email
passwordBodyYESStringN/A 

 

Output

Valid Response

Code Block
languagejs
titleValid 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

Code Block
languagejs
titleError Response from Login API
{
    "result":false,
    "errors":{
        "codes":[400],
        "details":[
            {
                "code":400,
                "message":"Problem with the provided password"
            }
        ]
    }
}

...

 

Code
Description
400Problem with the provided password
401Unable to log in the user. User not found.
logoutGET

Example (CURL)

...

Request

Code Block
languagebash
titleCalling Login Logout API
 > CURL -X POSTGET http://127.0.0.1:4000/urac/login -d 'username=john&password=johnpassword'logout

Response

Code Block
languagejs
titleLogin Logout 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="
}