Class CamundaClientCredentials

java.lang.Object
io.camunda.client.impl.CamundaClientCredentials

public final class CamundaClientCredentials extends Object
  • Field Details

    • EXPIRY_GRACE_PERIOD

      public static final Duration EXPIRY_GRACE_PERIOD
      Small safety margin subtracted from the actual token expiry when deciding whether the token is still usable. Guards against clock skew and in-flight latency between this check and the server validating the token; it is not a policy knob for refresh timing.
  • Constructor Details

    • CamundaClientCredentials

      public CamundaClientCredentials()
    • CamundaClientCredentials

      public CamundaClientCredentials(String accessToken, ZonedDateTime expiry, String tokenType)
  • Method Details

    • getAccessToken

      public String getAccessToken()
    • getTokenType

      public String getTokenType()
    • setExpiresIn

      public void setExpiresIn(String expiresIn)
    • getExpiry

      public String getExpiry()
    • setExpiry

      public void setExpiry(String expiry)
    • isValid

      public boolean isValid()
    • shouldRefreshProactively

      public boolean shouldRefreshProactively(Duration proactiveTokenRefreshThreshold)
      Returns true if the token has entered the proactive refresh window (i.e. it will expire within proactiveTokenRefreshThreshold) and a background refresh should be triggered. This is independent of isValid(): callers should compose the two, using isValid() to decide whether the token can still be served and this method to decide whether to kick off an eager refresh alongside. This avoids the cliff edge where all threads discover the token is invalid at the same time.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object