Login

Login

This API is only available in versions 0.x. As of versions 1.x, the login function is deprecated. You should login using oAuth, check the following Create/Update Token

General Information


Service

API

Method

Service

API

Method

urac

/login

POST

 

Data Model: Users

Workflow:  Login Flow

Input


Type: application/json

Name

Source

Mandatory

Type

Special Format

Description

Name

Source

Mandatory

Type

Special Format

Description

username

Body

YES

String

N/A

username or email

password

Body

YES

String

N/A

 

 

Output


Valid Response

Valid Response Sample
{ "result": true, "data": { "..." }

 

Invalid Response

Error Response Sample
{ "result":false, "errors":{ "codes":[413], "details":[ { "code":413, "message":"Problem with the provided password" } ] } }



Error Codes

 

Code

Description

Code

Description

413

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": { "packages": { "PROD1_PCK1": { "acl": { "urac": {} } } }, "keys": { "41eb3256ce660a891205d0a0eca19421": { "config": { "example01": { "tenantName": "Tenant name specific to john" } } } } }, "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=" }