Skip to content
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

Proxy settings do not take effect on oauth #31496

Open
RonsonNamek opened this issue Jun 26, 2024 · 0 comments
Open

Proxy settings do not take effect on oauth #31496

RonsonNamek opened this issue Jun 26, 2024 · 0 comments
Labels

Comments

@RonsonNamek
Copy link

RonsonNamek commented Jun 26, 2024

Description

I use gitea in docker, and set up oauth2 client with google. when i login with google, it shows account confirm page,
无标题

but after After continue, the page will stay for a few seconds, then redirect to my gitea page and show 500.

error page:
image

the gitea log:

2024/06/26 | 08:28:12 ...eb/routing/logger.go:68:func1() [W] router: slow GET /user/oauth2/Google/callback?state=ae3c5578-e834-46af-8213-030808afddcf&code=4%2F0ATx3LY5AXl-AaFvS2-Wd7HZQJG7S9AZj7R9C5_cXxXTf9vz7lEDHYlKpMx1SU30BkJ7sjw&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=consent for 172.17.0.1:57394, elapsed 3865.0ms @ auth/oauth.go:906(auth.SignInOAuthCallback)
2024/06/26 | 08:11:44 ...rs/web/auth/oauth.go:957:SignInOAuthCallback() [E] UserSignIn: Post "https://oauth2.googleapis.com/token": dial tcp 172.217.160.74:443: i/o timeout

i config proxy in app.ini:

[proxy]
PROXY_ENABLED = true
PROXY_URL     = socks://192.168.25.2:1080
PROXY_HOSTS   = *.gmail.com,*.googleapis.com

[oauth2_client]
REGISTER_EMAIL_CONFIRM = true
ENABLE_AUTO_REGISTRATION = false
USERNAME = nickname
UPDATE_AVATAR = true
ACCOUNT_LINKING = login

when i use commandline in docker containner and try to connect https://oauth2.googleapis.com it also timeout:

curl https://oauth2.googleapis.com

image

but if i use

curl -x socks://192.168.25.2:1080 https://oauth2.googleapis.com

I will receive a response in less than 1 second.
image

so it proved my proxy config is ok, but when gitea call https://oauth2.googleapis.com/token, It's not using the proxy I configured

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.45.1

Operating System

No response

How are you running Gitea?

docker

Database

PostgreSQL

@RonsonNamek RonsonNamek changed the title oauth2 client not use proxy setting Proxy settings do not take effect on oauth Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant