diff --git a/idp/casdoor.go b/idp/casdoor.go index 04a140ee..67b810cf 100644 --- a/idp/casdoor.go +++ b/idp/casdoor.go @@ -108,8 +108,8 @@ func (idp *CasdoorIdProvider) GetToken(code string) (*oauth2.Token, error) { type CasdoorUserInfo struct { Id string `json:"sub"` - Name string `json:"name"` - DisplayName string `json:"preferred_username"` + Name string `json:"preferred_username,omitempty"` + DisplayName string `json:"name"` Email string `json:"email"` AvatarUrl string `json:"picture"` Status string `json:"status"` diff --git a/idp/custom.go b/idp/custom.go index abd51714..5447272b 100644 --- a/idp/custom.go +++ b/idp/custom.go @@ -61,8 +61,8 @@ func (idp *CustomIdProvider) GetToken(code string) (*oauth2.Token, error) { type CustomUserInfo struct { Id string `json:"sub"` - Name string `json:"name"` - DisplayName string `json:"preferred_username"` + Name string `json:"preferred_username,omitempty"` + DisplayName string `json:"name"` Email string `json:"email"` AvatarUrl string `json:"picture"` Status string `json:"status"`