Authentication
Internal users can communicate with CTFreak using a RESTful JSON API.
Requests made to the API require an access token (to be renewed every 30 minutes) to identify the user.
For example, for demo user account (username: demo
/ password: demo
), you can obtain your access token via:
HTTP POST: https://demo.ctfreak.com/api/v1/token?grant_type=password&username=demo&password=demo
Response:
{ "access_token": "N4tbVp4iAGtJ-_HsfNjuRuyG79wL7xLsz1TpNLxi7B0=", "token_type": "Bearer", "userId": "01G9DEW9AAGQNEVZWF7QZ98WNA" }
All you have to do now is use this token in the http header of your other API requests:
Content-Type: application/json
Authorization: Bearer N4tbVp4iAGtJ-_HsfNjuRuyG79wL7xLsz1TpNLxi7B0=