com.aetrion.flickr.auth
Class AuthInterface

java.lang.Object
  extended by com.aetrion.flickr.auth.AuthInterface

public class AuthInterface
extends java.lang.Object

Authentication interface.

Author:
Anthony Eden

Field Summary
static java.lang.String METHOD_CHECK_TOKEN
           
static java.lang.String METHOD_GET_FROB
           
static java.lang.String METHOD_GET_FULL_TOKEN
           
static java.lang.String METHOD_GET_TOKEN
           
 
Constructor Summary
AuthInterface(java.lang.String apiKey, java.lang.String sharedSecret, Transport transport)
          Construct the AuthInterface.
 
Method Summary
 java.net.URL buildAuthenticationUrl(Permission permission, java.lang.String frob)
          Build the authentication URL using the given permission and frob.
 Auth checkToken(java.lang.String authToken)
          Check the authentication token for validity.
 java.lang.String getFrob()
          Get a frob.
 Auth getFullToken(java.lang.String miniToken)
          Get the full authentication token for a mini-token.
 Auth getToken(java.lang.String frob)
          Get an authentication token for the specific frob.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_CHECK_TOKEN

public static final java.lang.String METHOD_CHECK_TOKEN
See Also:
Constant Field Values

METHOD_GET_FROB

public static final java.lang.String METHOD_GET_FROB
See Also:
Constant Field Values

METHOD_GET_TOKEN

public static final java.lang.String METHOD_GET_TOKEN
See Also:
Constant Field Values

METHOD_GET_FULL_TOKEN

public static final java.lang.String METHOD_GET_FULL_TOKEN
See Also:
Constant Field Values
Constructor Detail

AuthInterface

public AuthInterface(java.lang.String apiKey,
                     java.lang.String sharedSecret,
                     Transport transport)
Construct the AuthInterface.

Parameters:
apiKey - The API key
transport - The Transport interface
Method Detail

checkToken

public Auth checkToken(java.lang.String authToken)
                throws java.io.IOException,
                       org.xml.sax.SAXException,
                       FlickrException
Check the authentication token for validity.

Parameters:
authToken - The authentication token
Returns:
The Auth object
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getFullToken

public Auth getFullToken(java.lang.String miniToken)
                  throws java.io.IOException,
                         org.xml.sax.SAXException,
                         FlickrException
Get the full authentication token for a mini-token.

Parameters:
miniToken - The mini-token typed in by a user. It should be 9 digits long. It may optionally contain dashes.
Returns:
an Auth object containing the full token, permissions and user info.
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getFrob

public java.lang.String getFrob()
                         throws java.io.IOException,
                                org.xml.sax.SAXException,
                                FlickrException
Get a frob.

Returns:
the frob
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getToken

public Auth getToken(java.lang.String frob)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Get an authentication token for the specific frob.

Parameters:
frob - The frob
Returns:
The Auth object
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

buildAuthenticationUrl

public java.net.URL buildAuthenticationUrl(Permission permission,
                                           java.lang.String frob)
                                    throws java.net.MalformedURLException
Build the authentication URL using the given permission and frob.

Parameters:
permission - The Permission
frob - The frob returned from getFrob()
Returns:
The URL
Throws:
java.net.MalformedURLException


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.