Opened 4 years ago

Last modified 3 years ago

#3439 new defect

Conflict between GoogleAuth (OAuth) and user info

Reported by: dustin Owned by:
Priority: major Milestone: 0.9.+
Version: master Keywords:
Cc: jan.vcelak@…

Change History (6)

comment:1 Changed 4 years ago by asedeno

  • Version changed from 0.8.12 to master

comment:2 Changed 4 years ago by dustin

  • Milestone changed from undecided to 0.9.+

comment:3 Changed 4 years ago by jvcelak

I'm affected by this bug as well. And I can help by sending a patch. But I'm not sure what is the proper fix.

I'm thinkng about the following solutions:

  1. The simplest one. Make the base implementation UserInfoProviderBase return an empty dictionary, instead of returning an username as the e-mail.
  1. Check if there is @ character in the username. If it is there use the username as the e-mail. Otherwise, return an empty dictionary.
  1. Pass the whole user information into getUserInfo and make the implementation to decide, which parameters should be updated.


comment:4 Changed 4 years ago by jvcelak

  • Cc jan.vcelak@… added

comment:5 Changed 4 years ago by tardyp

I would indeed opt for adding a updateUserInfo to getUserInfo to, and let it manage conficts something like this:

class UserInfoProviderBase(config.ConfiguredMixin):
    name = None

    def updateUserInfo(self, infos):
        new_infos = yield self.getUserInfo(infos['username'])
        return defer.succeed(infos)        

    def getUserInfo(self, username):
        raise NotImplemented

class UserInfoProviderDefault(config.ConfiguredMixin):
    name = "noinfo"

    def updateUserInfo(self, infos):
        if 'email' not in infos:
            infos.update({'email': username})
        return defer.succeed(infos)        
Note: See TracTickets for help on using tickets.