facebook4j.auth
Interface OAuthSupport

All Known Subinterfaces:
Facebook
All Known Implementing Classes:
FacebookBaseImpl, FacebookImpl, OAuthAuthorization

public interface OAuthSupport

Author:
Ryuji Yamashita - roundrop at gmail.com

Method Summary
 AccessToken getOAuthAccessToken()
          Returns an access token associated with this instance.
 AccessToken getOAuthAccessToken(java.lang.String oauthCode)
          Exchange the code for a User Access Token.
 AccessToken getOAuthAppAccessToken()
          Returns an App Access Token.
 java.lang.String getOAuthAuthorizationURL(java.lang.String callbackURL)
           
 java.lang.String getOAuthAuthorizationURL(java.lang.String callbackURL, java.lang.String state)
           
 void setOAuthAccessToken(AccessToken accessToken)
          Sets the access token
 void setOAuthAppId(java.lang.String appId, java.lang.String appSecret)
          sets the OAuth AppID and App secret
 void setOAuthPermissions(java.lang.String permissions)
          sets the permissions
 

Method Detail

setOAuthAppId

void setOAuthAppId(java.lang.String appId,
                   java.lang.String appSecret)
sets the OAuth AppID and App secret

Parameters:
appId - OAuth AppID
appSecret - OAuth App secret
Throws:
java.lang.IllegalStateException - when OAuth AppId has already been set

setOAuthPermissions

void setOAuthPermissions(java.lang.String permissions)
sets the permissions

Parameters:
permissions - comma-separated permission names
See Also:
Permissions Reference

getOAuthAuthorizationURL

java.lang.String getOAuthAuthorizationURL(java.lang.String callbackURL)

getOAuthAuthorizationURL

java.lang.String getOAuthAuthorizationURL(java.lang.String callbackURL,
                                          java.lang.String state)

getOAuthAccessToken

AccessToken getOAuthAccessToken()
Returns an access token associated with this instance.

Returns:
access token
Throws:
java.lang.IllegalStateException - when this instance has no access token
See Also:
Server-Side Authentication

getOAuthAccessToken

AccessToken getOAuthAccessToken(java.lang.String oauthCode)
                                throws FacebookException
Exchange the code for a User Access Token.

Parameters:
oauthCode - OAuth code.
Returns:
User Access Token
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Server-Side Authentication

getOAuthAppAccessToken

AccessToken getOAuthAppAccessToken()
                                   throws FacebookException
Returns an App Access Token.

Returns:
App Access Token
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Server-Side Authentication

setOAuthAccessToken

void setOAuthAccessToken(AccessToken accessToken)
Sets the access token

Parameters:
accessToken - accessToken