public class AndroidAuthenticator extends FlattrAuthenticator
FlattrAuthenticator that helps through the authentication
process on Android devices.| Constructor and Description |
|---|
AndroidAuthenticator(String host,
ConsumerKey consumerKey)
Constructs a new instance with the given
ConsumerKey. |
AndroidAuthenticator(String host,
String key,
String secret)
Constructs a new instance with the given consumer key and secret.
|
| Modifier and Type | Method and Description |
|---|---|
android.content.Intent |
createAuthenticateIntent()
Creates an
Intent for forwarding the user to the Flattr web page for
authentication. |
android.content.Intent |
createAuthenticateIntent(String state)
Creates an
Intent for forwarding the user to the Flattr web page for
authentication. |
AccessToken |
fetchAccessToken(android.net.Uri uri)
When the authentication was completed, your activity is resumed.
|
String |
getState(android.net.Uri uri)
Returns the state passed in with the
Intent. |
authenticate, authenticate, buildScopeString, createConnector, fetchAccessToken, getAccessTokenUrl, getCallbackUrl, getRequestTokenUrl, getResponseType, getScope, setAccessTokenUrl, setCallbackUrl, setRequestTokenUrl, setResponseType, setScopepublic AndroidAuthenticator(String host, ConsumerKey consumerKey)
ConsumerKey.host - Host name that is configured in the manifestconsumerKey - ConsumerKeypublic android.content.Intent createAuthenticateIntent()
throws FlattrException
Intent for forwarding the user to the Flattr web page for
authentication.
When the returned activity is started, a browser is opened. It shows a Flattr web page asking the user to authenticate and grant the requested scopes for your application.
When the authentication completes successfully, your activity is resumed with your callback URL passed in.
IntentFlattrExceptionpublic android.content.Intent createAuthenticateIntent(String state) throws FlattrException
Intent for forwarding the user to the Flattr web page for
authentication.
When the returned activity is started, a browser is opened. It shows a Flattr web page asking the user to authenticate and grant the requested scopes for your application.
When the authentication completes successfully, your activity is resumed with your callback URL passed in.
state - A value that is passed to the callback URL, to maintain state and
reidentify the user between request and callback. Optional, may be
null.IntentFlattrExceptionpublic AccessToken fetchAccessToken(android.net.Uri uri) throws FlattrException
Intent.uri - Uri that was passed in with the the Intent, containing
the callback URL from Flattr. It is safe to pass null here.AccessToken, or null if the Uri did not provide a
valid code.FlattrExceptionpublic String getState(android.net.Uri uri)
Intent. The state was set at
createAuthenticateIntent(String).uri - Uri that was passed in with the the Intent, containing
the callback URL from Flattr. It is safe to pass null here.null if no state was foundCopyright © 2010–2014. All rights reserved.