# API Authz with JWT works on one endpoint but not on tasks endpoint

**URL:** <https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162>\
**Category:** Site Operations Help\
**Tags:** api\
**Created:** [January 23, 2024, 3:49pm UTC](https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162 "2024-01-23T15:49:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurtfm](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kurtfm](https://discuss.openedx.org/u/kurtfm)\
**Post date:** [January 23, 2024, 3:49pm UTC](https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162/1 "2024-01-23T15:49:27Z")

</div>

I am developing some workflows using the REST API. I am successfully getting a JWT and using it for some studio APIs but /api/tasks… in particular doesn’t seem to accept the JWT and I can’t figure out why.

```auto
curl -X 'GET' \                                                                                                                                                                                    
  'http://studio.local.edly.io/api/content-staging/v1/clipboard/' \
  -H 'accept: application/json' \
  -H 'Authorization: JWT eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiAib3BlbmVkeCIsICJleHAiOiAxNzA2MDI3NTI4LCAiZ3JhbnRfdHlwZSI6ICJjbGllbnQtY3JlZGVudGlhbHMiLCAiaWF0IjogMTcwNjAyMzkyOCwgImlzcyI6ICJodHRwOi8vbG9jYWwuZWRseS5pby9vYXV0aDIiLCAicHJlZmVycmVkX3VzZXJuYW1lIjogImt1cnQiLCAic2NvcGVzIjogWyJyZWFkIiwgIndyaXRlIiwgImVtYWlsIiwgInByb2ZpbGUiXSwgInZlcnNpb24iOiAiMS4yLjAiLCAic3ViIjogIjhkZTIyYTQ4ZDcxYzNlYTVjNGZiYjQ1YTZkYjFjZDc4IiwgImZpbHRlcnMiOiBbXSwgImlzX3Jlc3RyaWN0ZWQiOiBmYWxzZSwgImVtYWlsX3ZlcmlmaWVkIjogdHJ1ZSwgImVtYWlsIjogImt1cnRAcmVkaXMuY29tIiwgIm5hbWUiOiAiIiwgImZhbWlseV9uYW1lIjogIiIsICJnaXZlbl9uYW1lIjogIiIsICJhZG1pbmlzdHJhdG9yIjogdHJ1ZSwgInN1cGVydXNlciI6IHRydWV9.oA2X5brThW50G63QaGsD0xGbskAOTqnKc00G3wYZXFk'
{"content":null,"source_usage_key":"","source_context_title":"","source_edit_url":""}%

```

```auto
curl -X 'GET' \                                                                                                                                                                                    
  'http://studio.local.edly.io/api/tasks/v0/artifacts/?page=1&page_size=20' \
  -H 'accept: application/json' \
  -H 'Authorization: JWT eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiAib3BlbmVkeCIsICJleHAiOiAxNzA2MDI3NTI4LCAiZ3JhbnRfdHlwZSI6ICJjbGllbnQtY3JlZGVudGlhbHMiLCAiaWF0IjogMTcwNjAyMzkyOCwgImlzcyI6ICJodHRwOi8vbG9jYWwuZWRseS5pby9vYXV0aDIiLCAicHJlZmVycmVkX3VzZXJuYW1lIjogImt1cnQiLCAic2NvcGVzIjogWyJyZWFkIiwgIndyaXRlIiwgImVtYWlsIiwgInByb2ZpbGUiXSwgInZlcnNpb24iOiAiMS4yLjAiLCAic3ViIjogIjhkZTIyYTQ4ZDcxYzNlYTVjNGZiYjQ1YTZkYjFjZDc4IiwgImZpbHRlcnMiOiBbXSwgImlzX3Jlc3RyaWN0ZWQiOiBmYWxzZSwgImVtYWlsX3ZlcmlmaWVkIjogdHJ1ZSwgImVtYWlsIjogImt1cnRAcmVkaXMuY29tIiwgIm5hbWUiOiAiIiwgImZhbWlseV9uYW1lIjogIiIsICJnaXZlbl9uYW1lIjogIiIsICJhZG1pbmlzdHJhdG9yIjogdHJ1ZSwgInN1cGVydXNlciI6IHRydWV9.oA2X5brThW50G63QaGsD0xGbskAOTqnKc00G3wYZXFk'
{"detail":"Authentication credentials were not provided."}

```

---

<div class="post-metadata">

**Author:** ![Anh\_Vu\_Nguy\_n](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/anh_vu_nguy_n/32/1740_2.png) [@Anh\_Vu\_Nguy\_n](https://discuss.openedx.org/u/Anh_Vu_Nguy_n)\
**Post date:** [January 24, 2024, 8:43am UTC](https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162/2 "2024-01-24T08:43:44Z")

</div>

Did it work with Bearer?

---

<div class="post-metadata">

**Author:** ![kurtfm](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kurtfm](https://discuss.openedx.org/u/kurtfm)\
**Post date:** [January 24, 2024, 3:06pm UTC](https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162/3 "2024-01-24T15:06:15Z")

</div>

I can use the same endpoint within the swagger UI, but not with a JWT… just when I am authorized. if that is what you mean.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)\
**Post date:** [April 23, 2024, 3:06pm UTC](https://discuss.openedx.org/t/api-authz-with-jwt-works-on-one-endpoint-but-not-on-tasks-endpoint/12162/4 "2024-04-23T15:06:20Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
