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
Post a Comment