See {@link OsiamConnector#getCurrentUser(AccessToken)}

@deprecated Use {@link #getMe(AccessToken, String...)} with OSIAM 3.x. This method
is going to go away with version 1.12 or 2.0.
333961
@Deprecated
    User getCurrentUser(AccessToken accessToken) {
        BasicUser basicUser = getCurrentUserBasic(accessToken);
        return getResource(basicUser.getId(), accessToken);
    }
1114686
protected Optional<UserProfile> retrieveUserProfileFromToken(final WebContext context, final T accessToken) {
        final OAuthProfileDefinition<U, T, O> profileDefinition = configuration.getProfileDefinition();
        final String profileUrl = profileDefinition.getProfileUrl(accessToken, configuration);
        final S service = this.configuration.buildService(context, client, null);
        final String body = sendRequestForData(service, accessToken, profileUrl, profileDefinition.getProfileVerb());
        logger.info("UserProfile: " + body);
        if (body == null) {
            throw new HttpCommunicationException("No data found for accessToken: " + accessToken);
        }
        final U profile = (U) configuration.getProfileDefinition().extractUserProfile(body);
        addAccessTokenToProfile(profile, accessToken);
        return Optional.of(profile);
    }
1046736
protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }

        if (!$this->tokenStorage->getToken()) {
            return;
        }

        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof UserInterface) {
            return $user;
        }

        return;
    }
1185342
@Deprecated
    public String getAccessToken() {
        Session s = getSession();
        if (s != null) {
            return s.getAccessToken();
        } else {
            return null;
        }
    }
1159843
User getUser(String id, AccessToken accessToken, String... attributes) {
        return getResource(id, accessToken, attributes);
    }
1157761
@Deprecated
    BasicUser getCurrentUserBasic(AccessToken accessToken) {
        checkAccessTokenIsNotNull(accessToken);

        StatusType status;
        String content;
        try {
            Response response = targetEndpoint.path("me").request(MediaType.APPLICATION_JSON)
                    .header("Authorization", BEARER + accessToken.getToken())
                    .property(ClientProperties.CONNECT_TIMEOUT, getConnectTimeout())
                    .property(ClientProperties.READ_TIMEOUT, getReadTimeout())
                    .get();

            status = response.getStatusInfo();
            content = response.readEntity(String.class);
        } catch (ProcessingException e) {
            throw new ConnectionInitializationException(CONNECTION_SETUP_ERROR_STRING, e);
        }

        checkAndHandleResponse(content, status, accessToken);

        return mapToType(content, BasicUser.class);
    }
468050
public String getUser()
  {
    if (tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getUser");
      SibTr.exit(tc, "getUser", user);
    }

    return user;
  }
102146
@Override
    public String getToken() throws TokenManagerException {
        if (hasTokenExpired()) {
            synchronized (this) {
                if (hasTokenExpired()) {
                    try {
                        final IAMToken iamToken = invokeTokenApi();
                        expiresAt = (long) (TimeUnit.SECONDS.toNanos(
                                iamToken.expires_in) * tokenExpiryThreshold)
                                + System.nanoTime();
                        token = iamToken.access_token;
                    } catch (final IAMTokenException e) {
                        throw new TokenManagerException("Failed getting Token.",
                                e);
                    }

                }
            }
        }
        return token;
    }
682659
@Override
    public OAuthToken get(String envKey) {
        try
        {
           FileInputStream fileIn = new FileInputStream(getFilePath(envKey));
           ObjectInputStream in = new ObjectInputStream(fileIn);
           OAuthToken token = (OAuthToken) in.readObject();
           in.close();
           fileIn.close();
           return token;
        } catch (Exception ex)
        {
            return null; // it's not an error: e.g. file not found cause not stored yet
        }
    }
767809
private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
    try {
      return Utils.getUGI();
    } catch (Exception e) {
      throw new HiveSQLException("Unable to get current user", e);
    }
  }
924475
@Deprecated
    public void cliConnect(boolean force) throws ExecutionException, InterruptedException {
        checkPermission(CONNECT);
        connect(force).get();
    }
681228
public GetCurrentUsersSavedAlbumsRequest.Builder getCurrentUsersSavedAlbums() {
    return new GetCurrentUsersSavedAlbumsRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port);
  }
1151554
@Provides
	@SessionScoped
	public UserLogin getLogin(@Named(JAXRS_SERVER_WEBAUTH_PROVIDER) CurrentUser user)
	{
		return (UserLogin) user;
	}
1270208
@Override
    public OAuth2AccessToken readAccessToken(String accessToken) {
        TokenValidation tokenValidation =
                tokenValidationService.validateToken(accessToken, true).checkJti();

        Map<String, Object> claims = tokenValidation.getClaims();
        accessToken = tokenValidation.getJwt().getEncoded();

        // Expiry is verified by check_token
        CompositeToken token = new CompositeToken(accessToken);
        token.setTokenType(OAuth2AccessToken.BEARER_TYPE);
        token.setExpiration(new Date(Long.valueOf(claims.get(EXP).toString()) * 1000L));

        @SuppressWarnings("unchecked")
        ArrayList<String> scopes = (ArrayList<String>) claims.get(SCOPE);
        if (null != scopes && scopes.size() > 0) {
            token.setScope(new HashSet<>(scopes));
        }
        String clientId = (String)claims.get(CID);
        String userId = (String)claims.get(USER_ID);
        BaseClientDetails client = (BaseClientDetails) clientDetailsService.loadClientByClientId(clientId, IdentityZoneHolder.get().getId());
        // Only check user access tokens
        if (null != userId) {
            @SuppressWarnings("unchecked")
            ArrayList<String> tokenScopes = (ArrayList<String>) claims.get(SCOPE);
            approvalService.ensureRequiredApprovals(userId, tokenScopes, (String) claims.get(GRANT_TYPE), client);
        }

        return token;
    }
284986
@CacheResult
  @Override
  public DOAuth2User get(@CacheKey Object parentKey, @CacheKey java.lang.Long id) throws IOException {
    return super.get(parentKey, id);
  }
94339
public OvhCredential currentCredential_GET() throws IOException {
		String qPath = "/auth/currentCredential";
		StringBuilder sb = path(qPath);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhCredential.class);
	}
1239761
public static String getUserToken(Config config, Context context) {
    AuthInfo authInfo = getUserAuthInfo(config, context);
    if (authInfo != null) {
      return authInfo.getToken();
    }
    return null;
  }