How to prevent calling ApplicationListener<AuthenticationSuccessEvent> after every api call in spring security with oauth2?

I have a requirement in my current project where I need to do some operation just after authentication user by calling /oauth/token. So I wrote a class like this

public class AuthSuccessListener implements ApplicationListener<AuthenticationSuccessEvent> {

  private String ationetUrl;

  private final TokenStore tokenStore;
  private final RestTemplate restTemplate;
  private final AtionetService ationetService;

  public AuthSuccessListener(
      TokenStore tokenStore, RestTemplate restTemplate, AtionetService ationetService) {
    this.tokenStore = tokenStore;
    this.restTemplate = restTemplate;
    this.ationetService = ationetService;

  public void onApplicationEvent(AuthenticationSuccessEvent event) {
    RedisService<String> redisService = new RedisService<>();
    String bespokeAccessToken = null;
    String ationetAccessToken = null;

    UserDetails userDetails = (UserDetails) event.getAuthentication().getPrincipal();
    List<OAuth2AccessToken> tokens =
            tokenStore.findTokensByClientIdAndUserName("unipet", userDetails.getUsername());
    bespokeAccessToken =

    try {
      String ationetAccesstoken =
          ationetService.getAccessToken("", "password");
      if (ationetAccesstoken != null) {
        redisService.setValue(bespokeAccessToken, ationetAccessToken);
    } catch (Exception e) {

But the problem is this method is being called after every api call. As a result api response became slow and the same thing happening again and again after every api call. So my requirement is I want to do this operation once just after authenticating a user, not after every api call. Any suggestions will be appreciated.