org.apache.abdera.ext.gdata
Class GoogleLoginAuthScheme

java.lang.Object
  extended by org.apache.commons.httpclient.auth.RFC2617Scheme
      extended by 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();
 
 AbderaClient client = new CommonsClient();
 client.addCredentials("http://beta.blogger.com", null, "GoogleLogin", new UsernamePasswordCredentials("email",
                                                                                                       "password"));
 


Constructor Summary
GoogleLoginAuthScheme()
           
 
Method Summary
 String authenticate(org.apache.commons.httpclient.Credentials credentials, org.apache.commons.httpclient.HttpMethod method)
           
 String authenticate(org.apache.commons.httpclient.Credentials credentials, String method, String uri)
           
protected  String getAuth(String id, String pwd)
           
protected  String getAuth(String id, String pwd, String service)
           
static String getGoogleLogin(String id, String pwd, String service)
           
 String getSchemeName()
           
 boolean isComplete()
           
 boolean isConnectionBased()
           
 void processChallenge(String challenge)
           
static void register(AbderaClient abderaClient, boolean exclusive)
           
 
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
 

Constructor Detail

GoogleLoginAuthScheme

public GoogleLoginAuthScheme()
Method Detail

register

public static void register(AbderaClient abderaClient,
                            boolean exclusive)

processChallenge

public void processChallenge(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 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
Throws:
org.apache.commons.httpclient.auth.AuthenticationException

authenticate

public String authenticate(org.apache.commons.httpclient.Credentials credentials,
                           String method,
                           String uri)
                    throws org.apache.commons.httpclient.auth.AuthenticationException
Specified by:
authenticate in interface org.apache.commons.httpclient.auth.AuthScheme
Throws:
org.apache.commons.httpclient.auth.AuthenticationException

getSchemeName

public String getSchemeName()
Specified by:
getSchemeName in interface org.apache.commons.httpclient.auth.AuthScheme

isComplete

public boolean isComplete()
Specified by:
isComplete in interface org.apache.commons.httpclient.auth.AuthScheme

isConnectionBased

public boolean isConnectionBased()
Specified by:
isConnectionBased in interface org.apache.commons.httpclient.auth.AuthScheme

getAuth

protected String getAuth(String id,
                         String pwd)

getAuth

protected String getAuth(String id,
                         String pwd,
                         String service)

getGoogleLogin

public static String getGoogleLogin(String id,
                                    String pwd,
                                    String service)


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.