Gitea OIDC doesn't send bearer token #8690

Closed
opened 2025-11-02 08:14:36 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @lvelvee on GitHub (Mar 14, 2022).

Gitea Version

1.16.3

Git Version

No response

Operating System

docker

How are you running Gitea?

gitea v1.16.3 running in docker

I got a 500 error when I use Open ID Connect.

In the OAuth2 server-side, I found token not presented.

Use another gitea instance as oauth server, but it's OK.

I'm not familiar with golang yet, so I have no idea debug with gitea.

the token response as follows

 {
  "access_token": "...",
  "token_type": "bearer",
  "expires_in": 3600,
  "refresh_token": "",
  "id_token": ""
}

my oauth provider

 {
  "access_token": "...",
  "expires_in": 36000,
  "token_type": "Bearer",
  "scope": "openid",
  "refresh_token": "...",
  "id_token": "..."
}

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

No response

Screenshots

iShot2022-03-14 11 25 19 iShot2022-03-14 11 22 00
Originally created by @lvelvee on GitHub (Mar 14, 2022). ### Gitea Version 1.16.3 ### Git Version _No response_ ### Operating System docker ### How are you running Gitea? gitea v1.16.3 running in docker I got a 500 error when I use Open ID Connect. In the OAuth2 server-side, I found token not presented. Use another gitea instance as oauth server, but it's OK. I'm not familiar with golang yet, so I have no idea debug with gitea. the token response as follows ```json { "access_token": "...", "token_type": "bearer", "expires_in": 3600, "refresh_token": "", "id_token": "" } ``` my oauth provider ```json { "access_token": "...", "expires_in": 36000, "token_type": "Bearer", "scope": "openid", "refresh_token": "...", "id_token": "..." } ``` ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description _No response_ ### Screenshots <img width="1638" alt="iShot2022-03-14 11 25 19" src="https://user-images.githubusercontent.com/25785753/158100946-aab023b5-f0ec-4c8e-8224-553f4d6c4978.png"> <img width="1656" alt="iShot2022-03-14 11 22 00" src="https://user-images.githubusercontent.com/25785753/158100955-aa81b88b-f34c-4499-bba3-147d190913eb.png">
Author
Owner

@lvelvee commented on GitHub (Mar 17, 2022):

After debugging it, I found out that it was my URL was https, but it was http in issuer.

Anyway, since I'm not familiar with golang and didn't find the specific code, it should have had a friendly hint.

@lvelvee commented on GitHub (Mar 17, 2022): After debugging it, I found out that it was my URL was https, but it was http in issuer. Anyway, since I'm not familiar with golang and didn't find the specific code, it should have had a friendly hint.
Author
Owner

@zeripath commented on GitHub (Mar 20, 2022):

Anyway, since I'm not familiar with golang and didn't find the specific code, it should have had a friendly hint.

What would be that hint? Where would you suggest it be? Any hint needs to cover a common problem - do you think your problem is that common? From your comments I can't actually tell what the problem was...

@zeripath commented on GitHub (Mar 20, 2022): > Anyway, since I'm not familiar with golang and didn't find the specific code, it should have had a friendly hint. What would be that hint? Where would you suggest it be? Any hint needs to cover a common problem - do you think your problem is that common? From your comments I can't actually tell what the problem was...
Author
Owner

@lvelvee commented on GitHub (Mar 20, 2022):

Actually my OAuth URL is https protocol, but the URL in .well_known/openid-configuration is http protocol due to a configuration error (it's my own application, and Gitea has nothing wrong), so no bearer token is sent to userinfo endpoint, that's all I know...

@lvelvee commented on GitHub (Mar 20, 2022): Actually my OAuth URL is https protocol, but the URL in `.well_known/openid-configuration` is `http` protocol due to a configuration error (it's my own application, and Gitea has nothing wrong), so **no bearer token is sent to userinfo endpoint**, that's all I know...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8690