We have a response, get the user identity out of it
494440
function (err, ok, state) {
        if (err) { return self.error(err); }
        if (!ok) { return self.fail(state, 403); }

        var samlResponse = self._samlp.decodeResponse(req);
        if (samlResponse.indexOf('<') === -1) {
          return self.fail('SAMLResponse should be a valid xml', 400);
        }

        var samlResponseDom = utils.parseSamlResponse(samlResponse);

        // If options are not set, we set the expected value from the request object
        var req_full_url = getReqUrl(req);
        self.options.destinationUrl = self.options.destinationUrl || req_full_url;
        self.options.recipientUrl = self.options.recipientUrl || req_full_url;


        self._samlp.validateSamlResponse(samlResponseDom, function (err, profile) {
          if (err) return self.fail(err, err.status || 400);

          var verified = function (err, user, info) {
            if (err) return self.error(err);
            if (!user) return self.fail(info);

            info = info || {};
            if (state) { info.state = state; }
            self.success(user, info);
          };

          if (self._passReqToCallback) {
            self._verify(req, profile, verified);
          } else {
            self._verify(profile, verified);
          }
        });
      }
367407
def _wrap_users(users, request):
    
    result = set()
    for u in users:
        if u is SELF and is_authenticated(request):
            result.add(request.user.get_username())
        else:
            result.add(u)
    return result
256640
def get_user_details(self, response):
        
        user = super(DataportenEmailOAuth2, self).get_user_details(response)
        user['username'] = user['email']
        return user
711882
def clean_username(self):
        
        username = self.cleaned_data.get('username').split('@')[0]
        if not username:
            raise forms.ValidationError(_('Invalid username provided'))
        return username
98861
def get_identities(self, item):
        """"""

        item = item['data']

        for field in ["assignee", "reporter", "creator"]:
            if field not in item["fields"]:
                continue
            if item["fields"][field]:
                user = self.get_sh_identity(item["fields"][field])
                yield user

        comments = item.get('comments_data', [])
        for comment in comments:
            if 'author' in comment and comment['author']:
                user = self.get_sh_identity(comment['author'])
                yield user
            if 'updateAuthor' in comment and comment['updateAuthor']:
                user = self.get_sh_identity(comment['updateAuthor'])
                yield user
691070
function usernameIsUnique ( id ) {
        var deferred = q.defer();

        db.users.query( [ { key: 'identities.basic.username', cmp: '=', value: user.identities.basic.username } ] ,
            { limit: 1, skip: 0 } ).then(
                function ( payload ) {
                    if ( payload.total === 0 ) {
                        deferred.resolve();
                    }
                    else if( !_.isUndefined( id ) && payload.results[0]._id.toString() === id.toString() ) {
                        deferred.resolve();
                    }
                    else {
                        deferred.reject( new Error(messages.duplicate_username) );
                    }
                },
                function ( err ) {
                    deferred.reject( err );
                }
            );

        return deferred.promise;
    }
1266426
def check_nick_matches_authenticated_user
      campfire.user("me") do |user|
        name = irc_name user.name
        if name != nick
          user_reply :nick, name
          @nick = name
        end
      end
    end
1214063
def user_parse(data):
        """"""
        _user = data.get('response', {}).get('user', {})
        yield 'id', _user.get('name')
        yield 'username', _user.get('name')
        yield 'link', _user.get('blogs', [{}])[0].get('url')
1095501
def identify(self, req, resp, resource, uri_kwargs):
        """"""
        try:
            return req.get_header('X-Api-Key', True)
        except (KeyError, HTTPMissingHeader):
            pass
672641
def parse_response(object)
      LOG.debug("response is #{object}")
      case object
        when ::Net::HTTPUnauthorized
          ::File.delete(ACCESS_TOKEN)
          raise 'user revoked oauth connection'
        when ::Net::HTTPOK then
          object.body
      end
    end
804607
def _read_response(self, response):
        
        # self.password = ''  # never returned
        self.name = response['name']
        self.email = response['email']
        self.admin = response['admin']
        self.profileUpdatable = response['profileUpdatable']
        self.internalPasswordDisabled = response['internalPasswordDisabled']
        self._groups = response['groups'] if 'groups' in response else []
        self._lastLoggedIn = response['lastLoggedIn'] if 'lastLoggedIn' in response else []
        self._realm = response['realm'] if 'realm' in response else []
280437
def get_user_details(self, response):
        """"""

        account = response['account']
        metadata = json.loads(account.get('json_metadata') or '{}')
        account['json_metadata'] = metadata

        return {
            'id': account['id'],
            'username': account['name'],
            'name': metadata.get("profile", {}).get('name', ''),
            'account': account,
        }
705505
def get_user(self, id, **data):
        
        
        return self.get("/users/{0}/".format(id), data=data)
840140
def hero_id(response):
    
    for player in response['players']:
        for hero in heroes['heroes']:
            if hero['id'] == player['hero_id']:
                player['hero_name'] = hero['localized_name']

    return response
983018
def _map_user_details(self, response):
        
        dest = {}
        for source_key, dest_key in self.CLAIMS_TO_DETAILS_KEY_MAP.items():
            value = response.get(source_key)
            if value is not None:
                dest[dest_key] = value

        return dest
94099
def user_parse(data):
        """"""
        user_ = data.get('user')
        yield 'id', user_.get('username')
        yield 'username', user_.get('username')
        yield 'first_name', user_.get('first_name')
        yield 'last_name', user_.get('last_name')
        yield 'picture', user_.get('avatar')
        yield 'link', user_.get('resource_url')
1193350
def leaver(response):
    
    for player in response['players']:
        for leaver in leavers:
            if leaver['id'] == player['leaver_status']:
                player['leaver_status_name'] = leaver['name']
                player['leaver_status_description'] = leaver['description']

    return response