From 83cbff33317b97582e17b656e44e38ff60b098b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20Wersd=C3=B6rfer?= Date: Thu, 19 Apr 2018 15:30:39 +0200 Subject: [PATCH] Tried token authentication today and found those small errors. If it really should have ben JWT and you are using djangorestframework-simplejwt then the action should look more like this: action = ['auth', 'token', 'obtain', 'create'] --- docs/topics/api-clients.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/topics/api-clients.md b/docs/topics/api-clients.md index 1de669b42..62ca2b402 100644 --- a/docs/topics/api-clients.md +++ b/docs/topics/api-clients.md @@ -269,12 +269,12 @@ For example, using the "Django REST framework JWT" package client = coreapi.Client() schema = client.get('https://api.example.org/') - action = ['api-token-auth', 'obtain-token'] - params = {username: "example", email: "example@example.com"} + action = ['api-token-auth', 'create'] + params = {"username": "example", "password": "secret"} result = client.action(schema, action, params) auth = coreapi.auth.TokenAuthentication( - scheme='JWT', + scheme='Token', token=result['token'] ) client = coreapi.Client(auth=auth)