public class Oauth2 extends Object
Constructor and Description |
---|
Oauth2(String oauth2URL,
String clientId,
String redirectURI)
Simple constructor
|
Oauth2(String oauth2URL,
String clientId,
String redirectURI,
String scope)
Simple constructor
|
Oauth2(String oauth2URL,
String clientId,
String redirectURI,
String scope,
String tokenRequestURL,
String clientSecret)
Simple constructor
|
Oauth2(String oauth2URL,
String clientId,
String redirectURI,
String scope,
String tokenRequestURL,
String clientSecret,
Hashtable additionalParams)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
String |
authenticate()
Deprecated.
use createAuthComponent or showAuthentication which work asynchronously and adapt better
to different platforms
|
Component |
createAuthComponent(ActionListener al)
This method creates a component which can authenticate.
|
static String |
getExpires()
Returns the expiry for the token received via oauth
|
static boolean |
isBackToParent()
Enables going back to the parent form after login is completed
|
static void |
setBackToParent(boolean aBackToParent)
Enables going back to the parent form after login is completed
|
void |
showAuthentication(ActionListener al)
This method shows an authentication for login form
|
public static final String TOKEN
public Oauth2(String oauth2URL, String clientId, String redirectURI)
oauth2URL
- the authentication url of the serviceclientId
- the client id that would like to use the serviceredirectURI
- the redirect uripublic Oauth2(String oauth2URL, String clientId, String redirectURI, String scope)
oauth2URL
- the authentication url of the serviceclientId
- the client id that would like to use the serviceredirectURI
- the redirect uriscope
- the authentication scopepublic Oauth2(String oauth2URL, String clientId, String redirectURI, String scope, String tokenRequestURL, String clientSecret)
oauth2URL
- the authentication url of the serviceclientId
- the client id that would like to use the serviceredirectURI
- the redirect uriscope
- the authentication scopeclientSecret
- the client secretpublic Oauth2(String oauth2URL, String clientId, String redirectURI, String scope, String tokenRequestURL, String clientSecret, Hashtable additionalParams)
oauth2URL
- the authentication url of the serviceclientId
- the client id that would like to use the serviceredirectURI
- the redirect uriscope
- the authentication scopeclientSecret
- the client secretadditionalParams
- hashtable of additional parameters to the
authentication requestpublic static boolean isBackToParent()
public static void setBackToParent(boolean aBackToParent)
aBackToParent
- the backToParent to setpublic static String getExpires()
public String authenticate()
IOException
- the method will throw an IOException if something went
wrong in the communication.public Component createAuthComponent(ActionListener al)
al
- a listener that will receive at its source either a token for the service or an exception in case of a failurepublic void showAuthentication(ActionListener al)
al
- a listener that will receive at its source either a token for the service or an exception in case of a failure