Logging in

From DreamFactory
Jump to: navigation, search
Line 31: Line 31:
  
 
> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._  
 
> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._  
 +
 +
* cURL:
 +
 +
<pre>curl -i -k -3 -X POST "http://localhost:8080/api/v2/system/admin/session" -d '{ "email" : "[email protected]", "password" : "some_password" }'</pre>
  
 
### Log in as an User (non-admin)
 
### Log in as an User (non-admin)

Revision as of 20:21, 19 January 2016

      1. Tutorial
      1. Log in as an Admin

The Admin login API is api/v2/system/admin/session

        1. API Endpoint
POST https://{url}/api/v2/system/admin/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}
        1. Example - Logging in as an Admin
  • Request body:
{
  "email": "[email protected]",
  "password": "secret",
  "remember_me": false
}
  • Request URL:
POST https://foo.com/api/v2/system/admin/session

> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._

  • cURL:
curl -i -k -3 -X POST "http://localhost:8080/api/v2/system/admin/session" -d '{ "email" : "[email protected]", "password" : "some_password" }'
      1. Log in as an User (non-admin)

The User login API is api/v2/user/session

        1. API Endpoint
POST https://{url}api/v2/user/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}
        1. Example - Logging in as an User (non-admin)
  • Request body:
{
  "email": "[email protected]",
  "password": "secret",
  "remember_me": false
}
  • Request URL:
POST https://foo.com/api/v2/user/session

> _Note: Set remember_me flag to 'true' in order to get a JWT (token) that can be refreshed forever (until logout) without authentication._