public interface TokenService
ClientToken.| Modifier and Type | Method and Description |
|---|---|
ClientToken |
forceRefresh(ClientConfiguration config,
ClientToken token)
Refreshes provided token.
|
boolean |
isRefreshNeeded(ClientToken token,
Duration margin)
Provides check to see if refresh is needed.
|
ClientToken |
refreshIfNeeded(ClientConfiguration config,
ClientToken token,
Duration margin)
Refreshes provided token if needed.
|
ClientToken forceRefresh(ClientConfiguration config, ClientToken token) throws TokenServiceException, IllegalArgumentException
config - OAuth client config for the given tokentoken - original tokenTokenServiceException - if there was an error while calling token endpointIllegalArgumentException - if token has no refresh tokenClientToken refreshIfNeeded(ClientConfiguration config, ClientToken token, Duration margin) throws TokenServiceException
config - OAuth client config for the given tokentoken - original tokenmargin - max lifetime of the token that should be refreshedTokenServiceExceptionboolean isRefreshNeeded(ClientToken token, Duration margin)
token with no refresh token this method will always return
false.token - original tokenmargin - max lifetime of the token that should be refreshedCopyright © 2020 Atlassian. All rights reserved.