Logging in

From DreamFactory
Jump to: navigation, search
Line 1: Line 1:
### Tutorial
+
=== Tutorial ===
  
### Log in as an Admin
+
=== Log in as an Admin ===
  
 
The Admin login API is api/v2/system/admin/session
 
The Admin login API is api/v2/system/admin/session
  
#### API Endpoint
+
==== API Endpoint ====
  
 
<pre>POST https://{url}/api/v2/system/admin/session</pre>
 
<pre>POST https://{url}/api/v2/system/admin/session</pre>
Line 17: Line 17:
 
</source>
 
</source>
  
#### Example - Logging in as an Admin
+
==== Example - Logging in as an Admin ====
  
 
* Request body:
 
* Request body:
Line 30: Line 30:
 
<pre>POST https://foo.com/api/v2/system/admin/session</pre>
 
<pre>POST https://foo.com/api/v2/system/admin/session</pre>
  
> _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:
 
* cURL:
Line 36: Line 37:
 
<pre>curl -i -k -3 -X POST "http://localhost:8080/api/v2/system/admin/session" -d '{ "email" : "[email protected]", "password" : "some_password" }'</pre>
 
<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) ===
  
 
The User login API is api/v2/user/session
 
The User login API is api/v2/user/session
  
#### API Endpoint
+
==== API Endpoint ====
  
 
<pre>POST https://{url}api/v2/user/session</pre>
 
<pre>POST https://{url}api/v2/user/session</pre>
Line 52: Line 53:
 
</source>
 
</source>
  
#### Example - Logging in as an User (non-admin)
+
==== Example - Logging in as an User (non-admin) ====
  
 
* Request body:
 
* Request body:
Line 65: Line 66:
 
<pre>POST https://foo.com/api/v2/user/session</pre>
 
<pre>POST https://foo.com/api/v2/user/session</pre>
  
> _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.''

Revision as of 16:22, 3 February 2016

Tutorial

Log in as an Admin

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

API Endpoint

POST https://{url}/api/v2/system/admin/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}

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" }'

Log in as an User (non-admin)

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

API Endpoint

POST https://{url}api/v2/user/session

Request body:

{
  "email": "user_email",
  "password": "password",
  "remember_me": bool
}

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.