chore: Little fixes for OAuth2 login

This commit is contained in:
jamesread 2025-11-26 23:28:29 +00:00
parent f33ccbd2fa
commit 7f1e509e12
3 changed files with 3 additions and 2 deletions

View File

@ -214,6 +214,7 @@ func parseJwt(cfg *config.Config, token string) *authTypes.AuthenticatedUser {
user := &authTypes.AuthenticatedUser{
Username: lookupClaimValueOrDefault(claims, cfg.AuthJwtClaimUsername, ""),
UsergroupLine: parseGroupClaim(cfg.AuthJwtClaimUserGroup, claims),
Provider: "jwt",
}
return user

View File

@ -33,7 +33,7 @@ func generateRSAKeyPair(t *testing.T) (*rsa.PrivateKey, []byte) {
pubPem := pem.EncodeToMemory(
&pem.Block{
Type: "RSA PUBLIC KEY",
Type: "PUBLIC KEY",
Bytes: pkixPubKey,
},
)

View File

@ -20,7 +20,7 @@ var oauth2ProviderDatabase = map[string]config.OAuth2Provider{
Title: "Google",
Name: "google",
Icon: "google",
UsernameField: "preferred_username",
UsernameField: "email",
WhoamiUrl: "https://www.googleapis.com/oauth2/v3/userinfo",
TokenUrl: endpoints.Google.TokenURL,
AuthUrl: endpoints.Google.AuthURL,