-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth2 OPTIONS /login/oauth/userinfo 405 #25473
Comments
I am having the same kind of issue with https://git.DOMAIN.de/login/oauth/access_token`. This happenes while I was trying to connect Decap CMS (Formerly Netlfy CMS) to gitea.
The same happens on the public site:
In my
Commenting or uncommenting the METHODS does not help. gitea (current docker image version 1.21) runs insude a docker container and even in there I get the same
|
Could you try this fix? Make CORS work for oauth2 handlers #28184 |
Fix #25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler.
Fix go-gitea#25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler.
Thanks for fixing it. |
@smainz You can use the latest nightly if the build already finished |
Backport #28184 Fix #25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler. Co-authored-by: wxiaoguang <[email protected]>
@wxiaoguang Thanks for the fast fix. It works" |
Fix go-gitea#25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler.
Fix go-gitea#25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler.
Description
I'm bypassing the #25469 issue and using the gitea version 1.20.0-rc.1.
I'm trying to complete an openid connect authentication using a blazor wasm and a library provided by microsoft.
the authentication process works for the following calls:
GET /.well-known/openid-configuration HTTP/1.1\r\n
POST /login/oauth/access_token HTTP/1.1\r\n
then the oidc library sends the following command to gitea:
OPTIONS /login/oauth/userinfo HTTP/1.1\r\n
Hypertext Transfer Protocol
OPTIONS /login/oauth/userinfo HTTP/1.1\r\n
Host: integra-swarm1:6442\r\n
Connection: keep-alive\r\n
Accept: /\r\n
Access-Control-Request-Method: GET\r\n
Access-Control-Request-Headers: authorization\r\n
Origin: http://127.0.0.1:5014\r\n
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51\r\n
Sec-Fetch-Mode: cors\r\n
Referer: http://127.0.0.1:5014/\r\n
Accept-Encoding: gzip, deflate\r\n
Accept-Language: en-US,en;q=0.9\r\n
\r\n
[Full request URI: http://integra-swarm1:6442/login/oauth/userinfo]
[HTTP request 3/3]
[Prev request in frame: 40]
[Response in frame: 47]
unfortunately gitea answers with a 405 error
Hypertext Transfer Protocol
HTTP/1.1 405 Method Not Allowed\r\n
Server: nginx/1.24.0\r\n
Date: Fri, 23 Jun 2023 15:03:45 GMT\r\n
Content-Length: 0\r\n
Connection: keep-alive\r\n
Cache-Control: max-age=0, private, must-revalidate, no-transform\r\n
Set-Cookie: i_like_gitea=5c01e91e8e09815e; Path=/; HttpOnly; SameSite=Lax\r\n
Set-Cookie: _csrf=UzrbRAgJyJA-x31jQEUwWZuWuhM6MTY4NzUzMjYyNTM4ODQ2NzQzMQ; Path=/; Max-Age=86400; HttpOnly; SameSite=Lax\r\n
X-Frame-Options: SAMEORIGIN\r\n
\r\n
[HTTP response 3/3]
[Time since request: 0.002656000 seconds]
[Prev request in frame: 40]
[Prev response in frame: 43]
[Request in frame: 45]
[Request URI: http://integra-swarm1:6442/login/oauth/userinfo]
could you help me investigate this issue?
Thanks
Gitea Version
1.20.0-rc.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
Ubuntu 22.04.2 LTS
How are you running Gitea?
I'm running GITEA as stack on docker swarm node.
image: gitea/gitea:1.20.0-rc.1
image: postgres:11-alpine
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: