# \[solved\] Oauth2 access\_token api - user not exist

**URL:** <https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [August 7, 2023, 5:05pm UTC](https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693 "2023-08-07T17:05:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davama](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/davama/32/3955_2.png) [@davama](https://forum.gitea.com/u/davama)\
**Post date:** [August 7, 2023, 5:05pm UTC](https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693/1 "2023-08-07T17:05:17Z")

</div>

Hello,

Testing oauth2\_client authentication with gitea, using OIDC as the provider. It works very well on the UI and im also able to map scope groups to org/teams, which is great!

I want to see if the api side accepts the JWT from the provider, as the [docs say](https://docs.gitea.com/development/api-usage?_highlight=api&_highlight=token#oauth2-provider), but when i try it, i get the error message:

```auto
{
    "message": "user does not exist [uid: 0, name: , keyid: 0]",
    "url": "https://gitea-dave.domain.net/api/swagger"
}

```

I tried this both on the `/api/swagger` page and on postman with the exact same error above.

I’ve tried it as a header and a parameter in the URL query string but no change.

Using `v1.20.2` from docker `latest-rootless` image.

What could i be doing wrong?

Any input is appreciated

Best,  
Dave

---

<div class="post-metadata">

**Author:** ![davama](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/davama/32/3955_2.png) [@davama](https://forum.gitea.com/u/davama)\
**Post date:** [August 7, 2023, 6:18pm UTC](https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693/2 "2023-08-07T18:18:37Z")

</div>

Just noticed that the api oauth2 link is regarding gitea “acting” as a oauth2 provider.

So probably the OP question is moot for now.

---

<div class="post-metadata">

**Author:** ![RileyCKR](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/rileyckr/32/6342_2.png) [@RileyCKR](https://forum.gitea.com/u/RileyCKR)\
**Post date:** [October 23, 2024, 3:30pm UTC](https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693/3 "2024-10-23T15:30:06Z")

</div>

I have the same use case: trying to authenticate to the Gitea API with a Bearer Token. It looks like the API only supports Basic Auth or use of API Token unfortunately.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [June 15, 2025, 1:26am UTC](https://forum.gitea.com/t/solved-oauth2-access-token-api-user-not-exist/7693/4 "2025-06-15T01:26:31Z")

</div>


