def oauth_user_info_getter(self, f):
def wraps(provider, response=None):<EOL><INDENT>ret = f(self, provider, response=response)<EOL>if not type(ret) == dict:<EOL><INDENT>log.error(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>type(ret)<EOL>)<EOL>)<EOL>return {}<EOL><DEDENT>return ret<EOL><DEDENT>self.oauth_user_info = wraps<EOL>return wraps<EOL>
Decorator function to be the OAuth user info getter
for all the providers, receives provider and response
return a dict with the information returned from the provider.
The returned user info dict should have it's keys with the same
name as the User Model.

Use it like this an example for GitHub ::

    @appbuilder.sm.oauth_user_info_getter
    def my_oauth_user_info(sm, provider, response=None):
        if provider == 'github':
            me = sm.oauth_remotes[provider].get('user')
            return {'username': me.data.get('login')}
        else:
            return {}