oauthP5.apis
Class DefaultApi20

java.lang.Object
  extended by oauthP5.apis.DefaultApi20
All Implemented Interfaces:
Api
Direct Known Subclasses:
FacebookApi, Foursquare2Api, KaixinApi20, LiveApi, RenrenApi, SinaWeiboApi20, VkontakteApi

public abstract class DefaultApi20
extends Object
implements Api

Default implementation of the OAuth protocol, version 2.0 (draft 11) This class is meant to be extended by concrete implementations of the API, providing the endpoints and endpoint-http-verbs. If your Api adheres to the 2.0 (draft 11) protocol correctly, you just need to extend this class and define the getters for your endpoints. If your Api does something a bit different, you can override the different extractors or services, in order to fine-tune the process. Please read the javadocs of the interfaces to get an idea of what to do.

Author:
Diego Silveira

Constructor Summary
DefaultApi20()
           
 
Method Summary
 OAuthService createService(OAuthConfig config)
          Creates an OAuthService
abstract  String getAccessTokenEndpoint()
          Returns the URL that receives the access token requests.
 AccessTokenExtractor getAccessTokenExtractor()
          Returns the access token extractor.
 Verb getAccessTokenVerb()
          Returns the verb for the access token endpoint (defaults to GET)
abstract  String getAuthorizationUrl(OAuthConfig config)
          Returns the URL where you should redirect your users to authenticate your application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultApi20

public DefaultApi20()
Method Detail

getAccessTokenExtractor

public AccessTokenExtractor getAccessTokenExtractor()
Returns the access token extractor.

Returns:
access token extractor

getAccessTokenVerb

public Verb getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to GET)

Returns:
access token endpoint verb

getAccessTokenEndpoint

public abstract String getAccessTokenEndpoint()
Returns the URL that receives the access token requests.

Returns:
access token URL

getAuthorizationUrl

public abstract String getAuthorizationUrl(OAuthConfig config)
Returns the URL where you should redirect your users to authenticate your application.

Parameters:
config - OAuth 2.0 configuration param object
Returns:
the URL where you should redirect your users

createService

public OAuthService createService(OAuthConfig config)
Creates an OAuthService

Specified by:
createService in interface Api
Returns:
fully configured OAuthService


Processing library oauthP5 by New York Times R&D Lab. (c) 2012