org.apache.abdera.ext.gdata
Class GoogleLoginAuthScheme
java.lang.Object
org.apache.commons.httpclient.auth.RFC2617Scheme
org.apache.abdera.ext.gdata.GoogleLoginAuthScheme
- All Implemented Interfaces:
- org.apache.commons.httpclient.auth.AuthScheme
public class GoogleLoginAuthScheme
- extends org.apache.commons.httpclient.auth.RFC2617Scheme
- implements org.apache.commons.httpclient.auth.AuthScheme
Implements the GoogleLogin auth scheme used by gdata (Blogger, Google Calendar, etc).
Warning: this scheme is slow!
GoogleLoginAuthScheme.register();
Client client = new CommonsClient();
client.addCredentials(
"http://beta.blogger.com",
null, "GoogleLogin",
new UsernamePasswordCredentials(
"email","password"));
Method Summary |
java.lang.String |
authenticate(org.apache.commons.httpclient.Credentials credentials,
org.apache.commons.httpclient.HttpMethod method)
|
java.lang.String |
authenticate(org.apache.commons.httpclient.Credentials credentials,
java.lang.String method,
java.lang.String uri)
|
protected java.lang.String |
getAuth(java.lang.String id,
java.lang.String pwd)
|
protected java.lang.String |
getAuth(java.lang.String id,
java.lang.String pwd,
java.lang.String service)
|
static java.lang.String |
getGoogleLogin(java.lang.String id,
java.lang.String pwd,
java.lang.String service)
|
java.lang.String |
getSchemeName()
|
boolean |
isComplete()
|
boolean |
isConnectionBased()
|
void |
processChallenge(java.lang.String challenge)
|
static void |
register()
|
Methods inherited from class org.apache.commons.httpclient.auth.RFC2617Scheme |
getID, getParameter, getParameters, getRealm |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.httpclient.auth.AuthScheme |
getID, getParameter, getRealm |
GoogleLoginAuthScheme
public GoogleLoginAuthScheme()
register
public static void register()
processChallenge
public void processChallenge(java.lang.String challenge)
throws org.apache.commons.httpclient.auth.MalformedChallengeException
- Specified by:
processChallenge
in interface org.apache.commons.httpclient.auth.AuthScheme
- Overrides:
processChallenge
in class org.apache.commons.httpclient.auth.RFC2617Scheme
- Throws:
org.apache.commons.httpclient.auth.MalformedChallengeException
authenticate
public java.lang.String authenticate(org.apache.commons.httpclient.Credentials credentials,
org.apache.commons.httpclient.HttpMethod method)
throws org.apache.commons.httpclient.auth.AuthenticationException
- Specified by:
authenticate
in interface org.apache.commons.httpclient.auth.AuthScheme
- Specified by:
authenticate
in class org.apache.commons.httpclient.auth.RFC2617Scheme
- Throws:
org.apache.commons.httpclient.auth.AuthenticationException
authenticate
public java.lang.String authenticate(org.apache.commons.httpclient.Credentials credentials,
java.lang.String method,
java.lang.String uri)
throws org.apache.commons.httpclient.auth.AuthenticationException
- Specified by:
authenticate
in interface org.apache.commons.httpclient.auth.AuthScheme
- Specified by:
authenticate
in class org.apache.commons.httpclient.auth.RFC2617Scheme
- Throws:
org.apache.commons.httpclient.auth.AuthenticationException
getSchemeName
public java.lang.String getSchemeName()
- Specified by:
getSchemeName
in interface org.apache.commons.httpclient.auth.AuthScheme
- Specified by:
getSchemeName
in class org.apache.commons.httpclient.auth.RFC2617Scheme
isComplete
public boolean isComplete()
- Specified by:
isComplete
in interface org.apache.commons.httpclient.auth.AuthScheme
- Specified by:
isComplete
in class org.apache.commons.httpclient.auth.RFC2617Scheme
isConnectionBased
public boolean isConnectionBased()
- Specified by:
isConnectionBased
in interface org.apache.commons.httpclient.auth.AuthScheme
- Specified by:
isConnectionBased
in class org.apache.commons.httpclient.auth.RFC2617Scheme
getAuth
protected java.lang.String getAuth(java.lang.String id,
java.lang.String pwd)
getAuth
protected java.lang.String getAuth(java.lang.String id,
java.lang.String pwd,
java.lang.String service)
getGoogleLogin
public static java.lang.String getGoogleLogin(java.lang.String id,
java.lang.String pwd,
java.lang.String service)