0

I use the following to fetch a token from an API:

# fetch the token
res = requests.post(url, data={"email": email, "password": password})
token_json = res.json()

# now can use the api
res = requests.post(authenticated_url, headers={
    "Authorization": "Bearer %s" % token_json['access']
}
data = res.json()

How would I set this up in Apiary? The closest I have seen to using authentication is this:

  • Relevant [Sending JWT Get Request containing username/password](https://stackoverflow.com/a/45884425/7414759) – stovfl Nov 02 '18 at 08:53
  • @stovfl I get that part, but how would I do that in apiary? –  Nov 02 '18 at 15:09
  • Reading the [GTRI-Apiary-Tutorial](https://github.com/jpastan/GTRI-Apiary-Tutorial/blob/master/general-setup.py) there is **no** `JWT` to use. They use a **Cert**. Follow this tutorial or [edit] your Question and explain **why** you have to use `JWT`. – stovfl Nov 02 '18 at 15:23

0 Answers0