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

loadOrCreateAsymmetricKey called when oauth2 is disabled #30266

Closed
pboguslawski opened this issue Apr 3, 2024 · 4 comments · Fixed by #32148
Closed

loadOrCreateAsymmetricKey called when oauth2 is disabled #30266

pboguslawski opened this issue Apr 3, 2024 · 4 comments · Fixed by #32148
Labels
Milestone

Comments

@pboguslawski
Copy link
Contributor

Description

When oauth2 is disabled in config with

[oauth2]
ENABLE = false

gitea is still trying to generate private key using jwtsigningkey.go:386:loadOrCreateAsymmetricKey(). Shouldn't oauth2.Init be skipped in this scenario?

Gitea Version

1.21.10

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

compiled from sources

Database

MySQL/MariaDB

@lunny
Copy link
Member

lunny commented Apr 3, 2024

I think some codes mixed Gitea as OAuth2 provider and Gitea as OAuth2 client.

@hawicz
Copy link

hawicz commented Jul 1, 2024

It also creates the private key in the wrong path. Here's a patch that fixes both of those problems
oauth_init.patch

@techknowlogick
Copy link
Member

Thanks @hawicz, I'm creating a PR with your patch. In the mainline branch the second part is caught prior to the load here: https://github.com/go-gitea/gitea/blob/main/modules/setting/oauth2.go#L129-L131 and in 1.22 too.

@lunny
Copy link
Member

lunny commented Sep 27, 2024

It also creates the private key in the wrong path. Here's a patch that fixes both of those problems oauth_init.patch

I cannot reproduce the error that the private.key in the wrong place.

@lunny lunny closed this as completed in 3a4a1bf Oct 2, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants