Get user name from Facebook, but the code provided.
@param token Facebook access token
@return The user found in FB
432864
private User fetch(final String token) {
        try {
            return new DefaultFacebookClient(
                token,
                this.requestor,
                new DefaultJsonMapper(),
                Version.LATEST
            ).fetchObject(
                "me", User.class
            );
        } catch (final FacebookException ex) {
            throw new IllegalArgumentException(ex);
        }
    }
340455
function _getUserDetailsFromFacebook() {
    return BB
        .bind(this)
        .then(function() {
            return facebook.query()
                .get('/me?access_token=' + this.params.access_token)
                .request();
        })
        .then(function(res) {
            this.socialUserInfo = res[1];
        });
}
999051
def _get_user_info(self, access_token):
        """"""
        info_response = self._call('GET', self.info_url, params={'access_token': access_token})
        user_info = info_response.get('info')
        return user_info
1239761
public static String getUserToken(Config config, Context context) {
    AuthInfo authInfo = getUserAuthInfo(config, context);
    if (authInfo != null) {
      return authInfo.getToken();
    }
    return null;
  }
937982
protected Object getAttribute(Token token) {
        Object object = null;
        if (activity.getProcessResult() != null) {
            object = activity.getProcessResult().getResultValue(token.getName());
        }
        if (object == null && activity.getRequestAdapter() != null) {
            object = activity.getRequestAdapter().getAttribute(token.getName());
        }
        if (object != null && token.getGetterName() != null) {
            object = getBeanProperty(object, token.getGetterName());
        }
        return (object != null ? object : token.getDefaultValue());
    }
1228441
public static Authenticator createFacebookAuthenticator(String token) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("access_token", token);
        return new TokenAuthenticator("_facebook", params);
    }
664129
@Override
  @Transactional(readOnly = true)
  @RunAsSystem
  public UserDetails findUserByToken(String token) {
    Token molgenisToken = getMolgenisToken(token);
    return userDetailsService.loadUserByUsername(molgenisToken.getUser().getUsername());
  }
600152
public Authentication getAuthentication(String token) {
		if (null != token) {
			TokenContainer container = tokens.get(token);
			if (null != container) {
				if (container.isValid()) {
					return container.getAuthentication();
				} else {
					logout(token);
				}
			}
		}
		return null;
	}
1057876
public UserRecoverRequest retrieveRecoverRequest(String token) {
		UserRecoverRequest req = this.dao.exists(token, UserRecoverRequest.class);
		if (req == null)
			return null;
		if (req.getExpiration().getTime() < System.currentTimeMillis())
			return null;
		if (req.isUsed())
			return null;
		return req;
	}
769129
public static  UUID getOrCreateUserToken() {
        UUID userToken;
        if (Request.getPerThreadRequestData().getRequestId() != null) {
            try {
                userToken = UUID.fromString(Request.getPerThreadRequestData().getRequestId());
            } catch (final IllegalArgumentException ignored) {
                userToken = UUIDs.randomUUID();
            }
        } else {
            userToken = UUIDs.randomUUID();
        }
        return userToken;
    }
58521
public function getAccessToken(): AccessToken
	{
		$helper = $this->facebook->getRedirectLoginHelper();

		try {
			// Get accessToken from $_GET
			$accessToken = $helper->getAccessToken();

			// Failed to get accessToken
			if (!isset($accessToken)) {
				if ($helper->getError() !== null) {
					throw new FacebookLoginException($helper->getError());
				} else {
					throw new FacebookLoginException('Facebook: Bad request.');
				}
			}

			$accessToken = $this->getLongLifeValidatedToken($accessToken);
		} catch (FacebookResponseException | FacebookSDKException $e) {
			throw new FacebookLoginException($e->getMessage());
		}

		return $accessToken;
	}
1242191
protected function getUserByToken($token)
    {
        return $this->sdkClient()
                    ->useCustomApiEndpoint($this->getEnvironmentEndpoint('api'))
                    ->setAccessToken($token)
                    ->uses('Profile')
                    ->get()
                    ->toArray();
    }
1057405
public static FacebookUserProfile getUserProfile(String userId) {
		String pageToken = FbBotMillContext.getInstance().getPageToken();
		BotMillNetworkResponse response = NetworkUtils
				.get(FbBotMillNetworkConstants.FACEBOOK_BASE_URL + userId
						+ FbBotMillNetworkConstants.USER_PROFILE_FIELDS
						+ pageToken);
		FacebookUserProfile user = FbBotMillJsonUtils.fromJson(
				response.getResponse(), FacebookUserProfile.class);
		return user;
	}
6272
private String getUserFromToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException {
    return authFactory.getUserFromToken(tokenStr);
  }
1021861
public User existsByInviteToken(String token) {
		Criteria criteria = this.dao.newCriteria(User.class).add(Restrictions.eq("inviteToken", token));
		return (User) criteria.uniqueResult();
	}
1263576
@Override
    public InstagramPaginatingResponse<InstagramUser> getFollowing(String accessToken,
                                                                   String userId) throws InstagramError {
        return instagramEndpoints.getFollowing(accessToken, userId);
    }
413879
public @CheckForNull User getUser(String name) {
        return User.get(name, User.ALLOW_USER_CREATION_VIA_URL && hasPermission(ADMINISTER));
    }