public class AuthorisationServiceImpl extends Object implements AuthorisationService
| Constructor and Description |
|---|
AuthorisationServiceImpl()
Default constructor creates a
RestAdapter which is the actual implementation of the REST interface |
| Modifier and Type | Method and Description |
|---|---|
Token |
tokenExchange(Integer clientId,
String clientSecret,
String code,
AuthorisationScope... scopes)
Strava will respond to the authorization request by redirecting the user/browser to the redirect_uri provided.
|
public AuthorisationServiceImpl()
Default constructor creates a RestAdapter which is the actual implementation of the REST interface
public Token tokenExchange(Integer clientId, String clientSecret, String code, AuthorisationScope... scopes) throws BadRequestException, UnauthorizedException
AuthorisationServiceStrava will respond to the authorization request by redirecting the user/browser to the redirect_uri provided.
On success, a code will be included in the query string.
If access is denied, error=access_denied will be included in the query string.
In both cases, if provided, the state argument will also be included.
If the user accepts the request to share access to their Strava data, Strava will redirect back to redirect_uri with the authorization code. The application must now exchange the temporary authorization code for an access token, using its client ID and client secret.
The application will now be able to make requests on the user's behalf using the access_token query string parameter (GET) or POST/PUT body, or the Authorization header.
Applications should check for a 401 Unauthorised response. Access for those tokens has been revoked by the user.
URL POST https://www.strava.com/oauth/token
tokenExchange in interface AuthorisationServiceclientId - application's ID, obtained during registrationclientSecret - application's secret, obtained during registrationcode - authorisation codescopes - the requested authorisation scopesBadRequestException - Where the request does not contain all the required informationUnauthorizedException - If client secret is invalidAuthorisationService.tokenExchange(java.lang.Integer, java.lang.String, java.lang.String, AuthorisationScope...)Copyright © 2016 Dan Shannon. All rights reserved.