Load extra data from provider and store it on current UserSocialAuth extra_data field.
6757
def load_extra_data(backend, details, response, uid, user, social_user=None, *args, **kwargs):
    
    social_user = social_user or UserSocialAuth.get_social_auth(backend.name, uid)
    # create verified email address
    if kwargs['is_new'] and EMAIL_CONFIRMATION:
        from ..models import EmailAddress
        # check if email exist before creating it
        # we might be associating an exisiting user
        if EmailAddress.objects.filter(email=user.email).count() < 1:
            EmailAddress.objects.create(user=user,
                                        email=user.email,
                                        verified=True,
                                        primary=True)

    if social_user:
        extra_data = backend.extra_data(user, uid, response, details)
        if kwargs.get('original_email') and 'email' not in extra_data:
            extra_data['email'] = kwargs.get('original_email')
        # update extra data if anything has changed
        if extra_data and social_user.extra_data != extra_data:
            if social_user.extra_data:
                social_user.extra_data.update(extra_data)
            else:
                social_user.extra_data = extra_data
            social_user.save()
        # fetch additional data from facebook on creation
        if backend.name == 'facebook' and kwargs['is_new']:
            response = json.loads(requests.get('https://graph.facebook.com/%s?access_token=%s' % (extra_data['id'], extra_data['access_token'])).content)
            try:
                user.city, user.country = response.get('hometown').get('name').split(', ')
            except (AttributeError, TypeError):
                pass
            try:
                user.birth_date = datetime.strptime(response.get('birthday'), '%m/%d/%Y').date()
            except (AttributeError, TypeError):
                pass
            user.save()
        return {'social_user': social_user}
73533
def put(self):
        """"""
        cred_payload = utils.uni_to_str(json.loads(request.get_data()))
        return self.manager.update_credential(cred_payload)
830492
def extra_metadata(self):
        """"""
        return get_extra_metadata(
            self.gh.api,
            self.repository['owner']['login'],
            self.repository['name'],
            self.release['tag_name'],
        )
775798
function(userId, extraData = {}) {
    if (!this.usingApiSecret || this.apiKey == null) {
      throw new errors.FeedError(
        'In order to create user tokens you need to initialize the API client with your API Secret',
      );
    }
    return signing.JWTUserSessionToken(this.apiSecret, userId, extraData, {
      noTimestamp: !this.expireTokens,
    });
  }
601123
def me(cls, api=None):
        
        api = api if api else cls._API
        extra = {
            'resource': cls.__name__,
            'query': {}
        }
        logger.info('Fetching user information', extra=extra)
        user_data = api.get(cls._URL['me']).json()
        return User(api=api, **user_data)
687312
def extra_prepare(self, configuration, args_dict):
        """"""
        aws_syncr = args_dict.pop("aws_syncr")

        self.configuration.update(
            { "$@": aws_syncr.get("extra", "")
            , "aws_syncr": aws_syncr
            , "templates": {}
            , "config_folder": self.configuration_folder
            }
        , source = "<args_dict>"
        )
68928
def _add_users(self, db, mongo_version):
        """"""
        if self.x509_extra_user:
            # Build dict of kwargs to pass to add_user.
            auth_dict = {
                'name': DEFAULT_SUBJECT,
                'roles': self._user_roles(db.client)
            }
            db.add_user(**auth_dict)
            # Fix kwargs to MongoClient.
            self.kwargs['ssl_certfile'] = DEFAULT_CLIENT_CERT

        # Add secondary user given from request.

        secondary_login = {
            'name': self.login,
            'roles': self._user_roles(db.client)
        }
        if self.password:
            secondary_login['password'] = self.password
        if mongo_version >= (3, 7, 2):
            # Use SCRAM_SHA-1 so that pymongo < 3.7 can authenticate.
            secondary_login['mechanisms'] = ['SCRAM-SHA-1']
        db.add_user(**secondary_login)
1088974
def add_data(self, addr, data):
        """"""
        data_len = len(data)
        if not addr == self._current_addr:
            logger.warning(
                'Address did not match when adding data to read request!')
            return

        # Add the data and calculate the next address to fetch
        self.data += data
        self._bytes_left -= data_len
        self._current_addr += data_len

        if self._bytes_left > 0:
            self._request_new_chunk()
            return False
        else:
            return True
1137118
def load_extra(cls, filename):
    
    try:
      with open(filename, 'rb') as configuration_file:
        cls.load_extra_data(configuration_file.read())
        sys.stderr.write("Config successfully loaded from {0:s}\n".format(
            filename))
        return True
    except IOError:
      return False
47746
def add(self, auth, method, args, notimeout=False):
        """"""
        authstr = self._authstr(auth)
        self._requests.setdefault(authstr, []).append((method, args))
        self._notimeouts.setdefault(authstr, False)
        if notimeout:
            self._notimeouts[authstr] = notimeout
938770
def get_extra_info(self, username):
        
        url = self._get_extra_info_url(username)
        return make_request(url, timeout=self.timeout)
1292025
function(provider, options) {
      var authType;
      if (_.isString(provider)) {
        authType = provider;
        provider = Parse.User._authProviders[provider];
      } else {
        authType = provider.getAuthType();
      }
      if (_.has(options, 'authData')) {
        var authData = this.get('authData') || {};
        authData[authType] = options.authData;
        this.set('authData', authData);

        // Overridden so that the user can be made the current user.
        var newOptions = _.clone(options) || {};
        newOptions.success = function(model) {
          model._handleSaveResult(true);
          if (options.success) {
            options.success.apply(this, arguments);
          }
        };
        return this.save({'authData': authData}, newOptions);
      } else {
        var self = this;
        var promise = new Parse.Promise();
        provider.authenticate({
          success: function(provider, result) {
            self._linkWith(provider, {
              authData: result,
              success: options.success,
              error: options.error
            }).then(function() {
              promise.resolve(self);
            });
          },
          error: function(provider, error) {
            if (options.error) {
              options.error(self, error);
            }
            promise.reject(error);
          }
        });
        return promise;
      }
    }
108222
def fetch_extra_data(resource):
    """"""
    person_id = resource.get('PersonID', [None])[0]
    identity_class = resource.get('IdentityClass', [None])[0]
    department = resource.get('Department', [None])[0]

    return dict(
        person_id=person_id,
        identity_class=identity_class,
        department=department
    )
1234277
def load_accounts(extra_path=None, load_user=True):
    

    from os.path import getmtime


    try:
        accts_file = find_config_file(ACCOUNTS_FILE, extra_path=extra_path, load_user=load_user)
    except ConfigurationError:
        accts_file = None

    if accts_file is not None and os.path.exists(accts_file):
        config = AttrDict()
        config.update_yaml(accts_file)

        if not 'accounts' in config:
            config.remotes = AttrDict()

        config.accounts.loaded = [accts_file, getmtime(accts_file)]
        return config
    else:
        return None
459960
def pre_social_login(self, request, sociallogin):
        """"""

        user = sociallogin.user
        # If the user hasn't been saved yet, it will be updated
        # later on in the sign-up flow.
        if not user.pk:
            return

        data = sociallogin.account.extra_data
        oidc = sociallogin.account.provider == 'helsinki_oidc'
        update_user(user, data, oidc)
860488
def _setextra(self, extradata):
        '''
        
        '''
        current = self
        while hasattr(current, '_sub'):
            current = current._sub
        _set(current, '_extra', extradata)
351229
function _loadUserFromToken(){
    return BB
        .bind(this)
        .then(function() {
            return grasshopper.request(this.token).users.current();
        })
        .then(function(user){
            this.user = user;
        });
}