Access Using JWT
From DreamFactory
Tracyosborn (Talk | contribs) m (Updated the example / details order to show the example first) |
|||
Line 20: | Line 20: | ||
=== Example - Using URL parameter === | === Example - Using URL parameter === | ||
+ | |||
+ | <pre>GET https://foo.com/api/v2/system/user?session_token=abc.123.efg</pre> | ||
* Service: system | * Service: system | ||
Line 26: | Line 28: | ||
* Method: GET | * Method: GET | ||
* Request URL: | * Request URL: | ||
− | |||
=== Example - Using request header === | === Example - Using request header === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
... | ... | ||
Line 40: | Line 35: | ||
... | ... | ||
</pre> | </pre> | ||
− | + | Request URL: | |
<pre>GET https://foo.com/api/v2/system/user</pre> | <pre>GET https://foo.com/api/v2/system/user</pre> | ||
+ | * Service: system | ||
+ | * Resource: user | ||
+ | * Session Token: abc.123.efg | ||
+ | * Method: GET | ||
+ | * Request Header: |
Revision as of 22:34, 5 May 2016
Contents
Tutorial
DreamFactory 2.0 APIs can be consumed with just a JWT (token) from an authenticated session. JWT from an admin user's session will allow full access to the system. Non-admin users cannot consume any protected APIs using just a JWT. He/she will also require an API Key and their access will be limited by the role assigned to them for the application of the API key being used.
API Endpoints
{Method} https://{url}/api/v2/{service}/{resource}?session_token={JWT}
-- OR --
{Method} https://{url}/api/v2/{service}/{resource}
Request header
... X-DreamFactory-Session-Token: {JWT} ...
Example - Using URL parameter
GET https://foo.com/api/v2/system/user?session_token=abc.123.efg
- Service: system
- Resource: user
- Session Token: abc.123.efg
- Method: GET
- Request URL:
Example - Using request header
... X-DreamFactory-Session-Token: abc.123.efg ...
Request URL:
GET https://foo.com/api/v2/system/user
- Service: system
- Resource: user
- Session Token: abc.123.efg
- Method: GET
- Request Header: