-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
Description
- Gitea version (or commit ref): latest (docker)
- Git version: 2.30.2
- Operating system: dockerized
- Database (use
[x]):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Log gist:
Description
I'm running Vouch Proxy, which used the user-management system and the Oauth2 provider of Gitea to validate users. After updating Vouch Proxy and Gitea to their latest version authentication application failed. After some digging I found that Gitea wasn't sending a username back to Vouch Proxy.
Error while retrieving user info after successful login at the OAuth provider: oauth2: cannot fetch token.
Response: {"error":"unauthorized_client","error_description":"client is not authorized"}
The same message was found in the Gitea logs:
server_1 | 2021/06/24 14:47:10 Started GET /login/oauth/authorize?client_id=5c496697-4b21-464c-9f46-bc3ea2e5f261&code_challenge=A8sIdk0unMIHC653omRFIXi2hnmsH3gq_oM-2wzuti8&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fvouch.doeber.nl%2Fauth&response_type=code&scope=read%3Auser&state=AEFsX8Tfz32rAU9nZBy4kDFK5TSL2v5 for 192.168.178.30:40354
server_1 | 2021/06/24 14:47:10 Completed GET /login/oauth/authorize?client_id=5c496697-4b21-464c-9f46-bc3ea2e5f261&code_challenge=A8sIdk0unMIHC653omRFIXi2hnmsH3gq_oM-2wzuti8&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fvouch.doeber.nl%2Fauth&response_type=code&scope=read%3Auser&state=AEFsX8Tfz32rAU9nZBy4kDFK5TSL2v5 302 Found in 1.042938ms
server_1 | 2021/06/24 14:47:10 Started GET /user/login for 192.168.178.30:40356
server_1 | 2021/06/24 14:47:10 Completed GET /user/login 200 OK in 9.860591ms
server_1 | 2021/06/24 14:47:10 Started GET /assets/css/index.css?v=68708fc921ee7542bbeb77c63470f7bf for 192.168.178.30:40358
server_1 | 2021/06/24 14:47:10 Completed GET /assets/css/index.css?v=68708fc921ee7542bbeb77c63470f7bf 200 OK in 1.277295ms
server_1 | 2021/06/24 14:47:10 Started GET /assets/js/index.js?v=68708fc921ee7542bbeb77c63470f7bf for 192.168.178.30:40364
server_1 | 2021/06/24 14:47:10 Completed GET /assets/js/index.js?v=68708fc921ee7542bbeb77c63470f7bf 200 OK in 1.141246ms
server_1 | 2021/06/24 14:47:10 Started GET /assets/img/logo.svg for 192.168.178.30:40366
server_1 | 2021/06/24 14:47:10 Completed GET /assets/img/logo.svg 200 OK in 405.598µs
server_1 | 2021/06/24 14:47:37 Started POST /user/login for 192.168.178.30:40378
server_1 | 2021/06/24 14:47:37 Completed POST /user/login 302 Found in 136.437286ms
server_1 | 2021/06/24 14:47:37 Started GET /login/oauth/authorize?client_id=5c496697-4b21-464c-9f46-bc3ea2e5f261&code_challenge=A8sIdk0unMIHC653omRFIXi2hnmsH3gq_oM-2wzuti8&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fvouch.doeber.nl%2Fauth&response_type=code&scope=read%3Auser&state=AEFsX8Tfz32rAU9nZBy4kDFK5TSL2v5 for 192.168.178.30:40380
server_1 | 2021/06/24 14:47:37 Completed GET /login/oauth/authorize?client_id=5c496697-4b21-464c-9f46-bc3ea2e5f261&code_challenge=A8sIdk0unMIHC653omRFIXi2hnmsH3gq_oM-2wzuti8&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fvouch.doeber.nl%2Fauth&response_type=code&scope=read%3Auser&state=AEFsX8Tfz32rAU9nZBy4kDFK5TSL2v5 302 Found in 18.569637ms
server_1 | 2021/06/24 14:48:05 Started POST /login/oauth/access_token for 192.168.178.30:40408
server_1 | 2021/06/24 14:48:05 Completed POST /login/oauth/access_token 400 Bad Request in 72.235882ms
server_1 | 2021/06/24 14:48:05 Started POST /login/oauth/access_token for 192.168.178.30:40410
server_1 | 2021/06/24 14:48:05 Completed POST /login/oauth/access_token 400 Bad Request in 65.530209ms
After looking at the api endpoint (swagger.v1.json) on my machine it seems to be the same as the default Vouch Proxy settings for Gitea.
My Vouch Proxy settings:

Did something change to the API endpoints?

