code: public static OAuthAccessToken getOAuthAccessToken(RequestContext requestContext, String provider, String... scopes) {
      HttpSession session = requestContext.getRequest().getSession();
      
      OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(String.format(PROVIDER_ACCESS_TOKENS, provider));
      if (accessTokens != null) {
        for (OAuthAccessToken accessToken : accessTokens) {
          List<String> accessTokenScopes = accessToken.getScopes() != null ? Arrays.asList(accessToken.getScopes()) : Collections.emptyList();
          if (scopes == null || accessTokenScopes.containsAll(Arrays.asList(scopes))) {
            if (isOAuthTokenExpired(accessToken)) {
              if ("Keycloak".equals(provider)) {
                return getKeycloakStrategy().refreshToken(requestContext, accessToken);
              }
            } else {
              return accessToken;
            }
          }
        }
      }
      
      return null;
    }
docs: Returns OAuth previously stored access token from HTTP session
  
  Null is returned if token is present but does not have requested scopes or
  the token has been expired
  
  @param requestContext request context
  @param provider token provider
  @param scopes required scopes
  @return OAuth previously stored access token from HTTP session