|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.kii.sdk.photocolle.Authority
public class Authority
Execute authentication.
Constructor Summary | |
---|---|
Authority()
|
Method Summary | |
---|---|
static void |
authenticate(Context context,
String clientId,
String clientSecret,
String redirectUri,
EnumSet<Scope> predefinedScopes,
String[] extendedScopes,
String storeKey,
AuthenticateCallback callback)
Invoke authentication process to get AuthenticationContext object. |
static void |
refreshToken(AuthenticationContext authenticationContext,
AuthenticateCallback callback)
Invoke refresh token process to update AuthenticationContext object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Authority()
Method Detail |
---|
public static void authenticate(Context context, String clientId, String clientSecret, String redirectUri, EnumSet<Scope> predefinedScopes, String[] extendedScopes, String storeKey, AuthenticateCallback callback) throws ParameterException
Access token is saved with specified storeKey. If valid access token is stored with specified storedKey, this method skips authentication and uses stored access token. Otherwise this method authenticate with PhotoColle network by OAuth2.0. After success of authentication, PhotoColleSDK saves retrieved access token with specified storeKey.
PhotoColleSDK refreshes access token if the stored token is going to
be expired. Calling this method or method in PhotoColle
requires authentication triggers refresh token. After the refresh
token succeeded, stored token will be overwritten with the storeKey
given to this method.
If refresh token fails in this method, this method start to authenticate with PhotoColle network.
If refresh token fails in the method of PhotoColle
,
PhotoColleSDK removes stored access token bound to specified storeKey.
Applications must need to request permissions with scope. Applications must send at least one scope to Docomo authentication server.
context
- Android context (Activity or so). must not be null.clientId
- The client id string which is issued for your
service. must not be null or empty.clientSecret
- The client secret string which is issued for
your service. must not be null or empty.redirectUri
- The redirect URI which you registered. must not be
null or empty.predefinedScopes
- Applications request permissions to Docomo
authentication server by Scopes
. One or more Scopes
can be set. The Scopes
is defined in
docomo Developer support API common reference version 2.0.0. If
extendedScopes is null or empty, then this parameter must not be null
or empty.extendedScopes
- Applications request permissions to Docomo
authentication server by scopes. If applications need to request
scopes defined after
docomo Developer support API common reference version 2.0.0,
applications can request these scopes with String values defined in a
newest specification. If predefinedScopes is null or empty, then this
parameter must not be null or empty. Elements of this array must not
be null or empty string. If same scope strings in this array, one of
the string is ignored.storeKey
- A key to save and load AuthenticationContext
automatically. If null or empty, automatic saving and loading does not
occur.callback
- The callback for receiving a result of authentication
process. must not be null.
ParameterException
- One or more arguments are invalid.public static void refreshToken(AuthenticationContext authenticationContext, AuthenticateCallback callback) throws ParameterException
Authority#authenticate(Context, String, String, String, EnumSet, Set,
String, AuthenticateCallback)
with valid
storeKey.AuthenticationContext.loadFrom(Context, String, String, String)
AuthenticationContext.saveTo(Context, String)
AuthenticationContext#getRemainingTimeInMilliseconds()
.
authenticationContext
- the authentication context to be
updated. must not be null. authenticationContext loaded by AuthenticationContext.loadFrom(Context, String)
can not be refreshed.callback
- The callback for receiving a result refresh token
process. must not be null.
ParameterException
- One or more arguments are invalid.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |