|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shredzone.flattr4j.oauth.FlattrAuthenticator org.shredzone.flattr4j.oauth.AndroidAuthenticator
public class AndroidAuthenticator
An extension of FlattrAuthenticator
that helps through the authentication
process on Android devices.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 . |
Methods inherited from class org.shredzone.flattr4j.oauth.FlattrAuthenticator |
---|
authenticate, authenticate, buildScopeString, createConnector, fetchAccessToken, getCallbackUrl, getResponseType, getScope, setCallbackUrl, setResponseType, setScope |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AndroidAuthenticator(String host, ConsumerKey consumerKey)
ConsumerKey
.
host
- Host name that is configured in the manifestconsumerKey
- ConsumerKey
public AndroidAuthenticator(String host, String key, String secret)
host
- Host name that is configured in the manifestkey
- Consumer keysecret
- Consumer secretMethod Detail |
---|
public 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.
Intent
FlattrException
public 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
.
Intent
FlattrException
public 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.
FlattrException
public 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 found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |