Open raphink opened 8 years ago
Use case: in gogs, the field can be used to automatically create users. Passing usernames makes more sense than passing emails for that need.
This would also be very useful for GitHub, where the user's primary email can often be meaningless to the upstream service (especially if they have a dozen emails on their account like I do), but the username is a useful identifier.
+1, what can we do to get this added? Thanks!
Hi, I'm not a go dev, but my guess is that the issue is here
func (s *SessionState) userOrEmail() string {
u := s.User
if s.Email != "" {
u = s.Email
}
return u
}
As you can see, if the user has an email (which happens all the time), the email overrides the username. My proposal would be to, either:
As I said, I don't know golang. How I can I compile and test the changes I could make ? (Code is already cloned on my laptop)
Currently, Oauth2_proxy computers session User from session Email (as the left part of the email string).
It would be better to have providers provide that information, to have a correct X-Forwarded-User value.