Authentication¶
Facebook-login¶
Logging users in with facebook
-
POST
/api/login/facebook
¶ The body should look like this:
{"token": "token_acquired_from_facebook"}
the response will look like this:
{"token": "2G5K7KBUeKpjSyz1PWmfV36hr83O0NoAIf7dqXz4DaDl"}
Which is the token required for NTHU ION’s API
You should then put the token in the header for other requests, for example:
GET /api/private/content HTTP/1.1 Authorization: Token 2G5K7KBUeKpjSyz1PWmfV36hr83O0NoAIf7dqXz4DaDl
Status Codes: - 200 OK – on successful login
- 400 Bad Request – malformed POST body
- 401 Unauthorized – rejected facebook token