{"_id":"58659fe851a7520f005610e5","user":"54fb2a5f3dc1790d00b54206","project":"54fb204867c8370d00b5c269","__v":1,"version":{"_id":"571d54d418b3c10e003e55b9","project":"54fb204867c8370d00b5c269","hasDoc":true,"hasReference":true,"__v":3,"createdAt":"2016-04-24T23:20:52.805Z","releaseDate":"2016-04-24T23:20:52.805Z","categories":["571d54d418b3c10e003e55ba","571d54d418b3c10e003e55bb","571d54d418b3c10e003e55bc","586982e31c8ac62300359a78","5869833f6dab552500c677cb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"571d54d418b3c10e003e55bc","version":"571d54d418b3c10e003e55b9","__v":0,"project":"54fb204867c8370d00b5c269","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-05-01T00:55:01.670Z","from_sync":false,"order":4,"slug":"api","title":"Token API"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-12-29T23:44:40.044Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{\n  isRegistered: true,\n  csbToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\"\n}","name":""},{"status":401,"language":"json","code":"{\n\terror: String\n}"},{"status":422,"code":"{\n\terror: 'Missing parameters: <missing params here>'\n}","language":"json"}]},"settings":"","auth":"required","params":[{"_id":"58659fe851a7520f005610e6","ref":"","in":"body","required":false,"desc":"One of 'github', 'wordpress', or 'stack_exchange'.","default":"","type":"string","name":"authenticationProvider"},{"_id":"5865a13e8356882d00fe1960","ref":"","in":"body","required":false,"desc":"Acquired after the user authenticates with their authentication provider.","default":"","type":"string","name":"accessToken"},{"_id":"5865a13e8356882d00fe195f","ref":"","in":"body","required":false,"desc":"Required only for Stack Exchange, the client key secret from your registered Stack Exchange app.","default":"","type":"string","name":"accessAppKey"}],"url":"/token"},"isReference":true,"order":0,"body":"In order to access registered user functions of CS Blogs, you must authenticate the user with the API using credentials from their authentication provider (GitHub, Wordpress, or Stack Exchange).\n\nA successful response will return you a [JWT token](https://jwt.io) to authenticate future request to CS Blogs with, and a boolean stating whether the user is registered (in order to register them using the new JWT token).","excerpt":"","slug":"token","type":"endpoint","title":"/token"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

authenticationProvider:
string
One of 'github', 'wordpress', or 'stack_exchange'.
accessToken:
string
Acquired after the user authenticates with their authentication provider.
accessAppKey:
string
Required only for Stack Exchange, the client key secret from your registered Stack Exchange app.

Result Format


Documentation

In order to access registered user functions of CS Blogs, you must authenticate the user with the API using credentials from their authentication provider (GitHub, Wordpress, or Stack Exchange). A successful response will return you a [JWT token](https://jwt.io) to authenticate future request to CS Blogs with, and a boolean stating whether the user is registered (in order to register them using the new JWT token).

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}