def auth_user_oauth(self, userinfo):
        if 'username' in userinfo:
            user = self.find_user(username=userinfo['username'])
        elif 'email' in userinfo:
            user = self.find_user(email=userinfo['email'])
        else:
            log.error('User info does not have username or email {0}'.format(userinfo))
            return None
        if user is None or (not user.is_active()):
            return None
        else:
            self.update_user_auth_stat(user)
            return user
OAuth user Authentication
dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/security/manager.py/BaseSecurityManager.auth_user_oauth