public class AuthorizationApi extends Object
Constructor and Description |
---|
AuthorizationApi() |
Modifier and Type | Method and Description |
---|---|
AuthCallback |
authorize(String clientId,
String decision,
String userId,
String scope,
String redirectUri,
String state,
String responseType)
Authorize a user
This endpoint is called when the user allow or deny permission \nin the decision page\n
|
TokenInfos |
check(String accessToken)
Check the validity of an access token and give back his permission, \nclient_id and user_id\n
|
String |
getBasePath() |
ApiInvoker |
getInvoker() |
static void |
initialize(String providerId,
String providerSecret) |
void |
setBasePath(String basePath) |
TokenSet |
token(String clientId,
String clientSecret,
String grantType,
String scope,
String code,
String refreshToken)
Access token retrieval (with code) or refresh (with refresh token)
|
public AuthCallback authorize(String clientId, String decision, String userId, String scope, String redirectUri, String state, String responseType) throws ApiException
clientId
- Client IDdecision
- Must be set to '1' if the user allowed the app, or '0' if the user denied the authorizationuserId
- User IDscope
- List of permission (space delimiter)redirectUri
- Redirect URIstate
- CORS tokenresponseType
- Response typeApiException
public TokenInfos check(String accessToken) throws ApiException
accessToken
- The access token you want to checkApiException
public String getBasePath()
public ApiInvoker getInvoker()
public void setBasePath(String basePath)
public TokenSet token(String clientId, String clientSecret, String grantType, String scope, String code, String refreshToken) throws ApiException
clientId
- Client IDclientSecret
- Client SecretgrantType
- authorization_code or client_credential or refresh_tokenscope
- Space separated scope list (e.g. \"email friends_list\"). Used only if grant_type = client_credentialcode
- Code received from /authorize step. Required if grant_type = authorization_coderefreshToken
- Refresh token (long-live token) used to refresh the access token (short-live token). Required if grant_type = refresh_tokenApiException
Copyright © 2015. All rights reserved.