chore: Little fixes for OAuth2 login
This commit is contained in:
parent
f33ccbd2fa
commit
7f1e509e12
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue