layout | toc | title | slug | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
docs-api |
toc-api-admin.html |
POST /auth/token |
|
Exchange credentials for access token
Header | Value |
---|---|
Authorization |
Bearer [token] |
Content-type |
application/json |
The request body must be a JSON string with the following fields:
Field | Description |
---|---|
client_id |
identifies the client. Currently, must be either node-red-admin or node-red-editor . |
grant_type |
must be password |
scope |
a space-separated list of permissions being requested. Currently, must be either * or read . |
username |
the username to authenticate |
password |
the password to authenticate |
Status Code | Reason | Response |
---|---|---|
200 |
Success | See example response body |
401 |
Not authorized | none |
{% highlight json %} { "access_token": "A_SECRET_TOKEN", "expires_in":604800, "token_type": "Bearer" } {% endhighlight %}