firebase / firebase-admin-go

Firebase Admin Go SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: Parse screenName from ProvidedUserInfo

sixstone-qq opened this issue · comments

Describe your environment

  • Operating System version: Linux
  • Firebase SDK version: v4.13.0
  • Library version: v4.13.0
  • Firebase Product: auth

Describe the problem

Steps to reproduce:

When a user is logged in using GitHub as provider it returns the screenName aka login in GitHub when requesting this information via accounts.lookup in ProvidedUserInfo as described in https://cloud.google.com/identity-platform/docs/reference/rest/v1/ProviderUserInfo

Relevant Code:

Missing ScreenName field from auth.UserInfo struct to parse it into memory.

--- a/auth/user_mgt.go
+++ b/auth/user_mgt.go
@@ -59,6 +59,9 @@ type UserInfo struct {
        // In UserRecord.UserInfo it will return the constant string "firebase".
        ProviderID string `json:"providerId,omitempty"`
        UID        string `json:"rawId,omitempty"`
+       // ScreenName is the user's screen name at Twitter or login name at GitHub.
+       // Only populated in ProviderUserInfo[]
+       ScreenName string `json:"screenName,omitempty"`
 }