Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/Enable token authorization for API calls #317

Merged
merged 1 commit into from Aug 20, 2019

Conversation

@c-w
Copy link
Member

c-w commented Aug 1, 2019

As discussed in #299, there is desire to interact with Doccano via the API since this enables integrating Doccano with others systems, e.g. fetch data from system A, push it into Doccano, and later sync the labels to system B.

In order to facilitate usage of Doccano via the API, this pull request adds token authentication to the API:

# fetch an auth token once for non-interactive usage of the API
curl 'http://localhost:8000/v1/auth-token' -d '{"username": "user", "password": "pass"}' -H 'Content-Type: application/json'

# at a later point, can use the auth token to interact with the API
curl 'http://localhost:8000/v1/me' -H 'Authorization: Token xxxxxxxxx'
@Hironsan Hironsan merged commit b190a79 into doccano:master Aug 20, 2019
2 checks passed
2 checks passed
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Travis CI - Pull Request Build Passed
Details
@c-w c-w deleted the CatalystCode:enhancement/api-auth branch Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.