Merge pull request #1586 from serhiimakogon/fix/refresh-handler

preferred_username claim added on refresh token
This commit is contained in:
Nándor István Krácser 2019-11-19 15:39:17 +01:00 committed by GitHub
commit c392236f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -969,12 +969,13 @@ func (s *Server) handleRefreshToken(w http.ResponseWriter, r *http.Request, clie
return return
} }
ident := connector.Identity{ ident := connector.Identity{
UserID: refresh.Claims.UserID, UserID: refresh.Claims.UserID,
Username: refresh.Claims.Username, Username: refresh.Claims.Username,
Email: refresh.Claims.Email, PreferredUsername: refresh.Claims.PreferredUsername,
EmailVerified: refresh.Claims.EmailVerified, Email: refresh.Claims.Email,
Groups: refresh.Claims.Groups, EmailVerified: refresh.Claims.EmailVerified,
ConnectorData: refresh.ConnectorData, Groups: refresh.Claims.Groups,
ConnectorData: refresh.ConnectorData,
} }
// Can the connector refresh the identity? If so, attempt to refresh the data // Can the connector refresh the identity? If so, attempt to refresh the data
@ -1036,6 +1037,7 @@ func (s *Server) handleRefreshToken(w http.ResponseWriter, r *http.Request, clie
// //
// UserID intentionally ignored for now. // UserID intentionally ignored for now.
old.Claims.Username = ident.Username old.Claims.Username = ident.Username
old.Claims.PreferredUsername = ident.PreferredUsername
old.Claims.Email = ident.Email old.Claims.Email = ident.Email
old.Claims.EmailVerified = ident.EmailVerified old.Claims.EmailVerified = ident.EmailVerified
old.Claims.Groups = ident.Groups old.Claims.Groups = ident.Groups