public class TokenServiceImpl extends StravaServiceImpl implements TokenService
api, requestRate, requestRateDaily| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clear any and all cached data entries
|
TokenResponse |
deauthorise(Token token)
Allows an application to revoke its access to an athlete's data.
|
static TokenService |
instance(Token token)
Returns an instance of
token services |
accessTokenIsValid, future, getToken, requestRateDailyPercentage, requestRatePercentagepublic static TokenService instance(Token token) throws UnauthorizedException
Returns an instance of token services
Instances are cached so that if 2 requests are made for the same token, the same instance is returned
token - The Strava access token to be used in requests to the Strava APIUnauthorizedException - If the token used to create the service is invalidpublic void clearCache()
StravaServiceClear any and all cached data entries
Primarily used when revoking/deauthorising a token so that there are no entries remaining that are associated with the token that could mistakenly get returned
clearCache in interface StravaServiceStravaService.clearCache()public TokenResponse deauthorise(Token token) throws UnauthorizedException
TokenServiceAllows an application to revoke its access to an athlete's data.
This will invalidate all access tokens associated with the athlete, application pair used to create the token. The application will be removed from the StravaAthlete Settings page on Strava.
All requests made using invalidated tokens will receive a 401 Unauthorised response.
URL POST https://www.strava.com/oauth/deauthorize
deauthorise in interface TokenServicetoken - The access token for which the application is revoking its access.UnauthorizedException - if the token is not allowed to be deauthorisedTokenService.deauthorise(Token)Copyright © 2016 Dan Shannon. All rights reserved.