Class TokenGenerator

java.lang.Object
org.bhn.promotion.iam.token.TokenGenerator

@Component public class TokenGenerator extends Object
  • Constructor Details

    • TokenGenerator

      public TokenGenerator()
  • Method Details

    • getTokenWithRetry

      @Retryable(backoff=@Backoff(delay=1000L)) public String getTokenWithRetry(String source)
    • getAccessToken

      public String getAccessToken(String source)
      Retrieves an access token by making an HTTP POST request to the configured promotion token service.
      Returns:
      the access token as a String, or null if an error occurs.
    • createTokenRequestPayload

      protected org.springframework.util.MultiValueMap<String,String> createTokenRequestPayload()
      Creates the payload for the token request to the IAM service, including the client credentials.
      Returns:
      a MultiValueMap representing the token request payload.