core api - Having Trouble with Authentication for Python CoreAPI -


i have tried 2 documented methods authentication, both yield 403 forbidden, detail: "authentication credentials not provided."

auth = coreapi.auth.tokenauthentication( scheme='token', token='token') 

and

auth = coreapi.auth.basicauthentication( username='user', password='password')  url = 'http://127.0.0.1:8000/schema/' client = coreapi.client(auth=auth) schema = client.get(url) 

based on source code of coreapi.auth.basicauthentication , coreapi.auth.tokenauthentication here, need instantiate authentication object follows :

auth = coreapi.auth.tokenauthentication( scheme='token', token='token', domain='domain') 

or

auth = coreapi.auth.basicauthentication( username='user', password='password', domain='domain'   )  

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -