facebook4j.auth
Interface OAuthSupport

All Known Subinterfaces:
Facebook
All Known Implementing Classes:
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(String oauthCode)
          Exchange the code for a User Access Token.
 AccessToken getOAuthAccessToken(String oauthCode, String callbackURL)
          Exchange the code for a User Access Token.
 AccessToken getOAuthAppAccessToken()
          Returns an App Access Token.
 String getOAuthAuthorizationURL(String callbackURL)
           
 String getOAuthAuthorizationURL(String callbackURL, String state)
           
 String getOAuthCallbackURL()
          Sets the access token and callback URL
 void setOAuthAccessToken(AccessToken accessToken)
          Sets the access token
 void setOAuthAppId(String appId, String appSecret)
          sets the OAuth AppID and App secret
 void setOAuthCallbackURL(String callbackURL)
          Sets the access token
 void setOAuthPermissions(String permissions)
          sets the permissions
 

Method Detail

setOAuthAppId

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

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

setOAuthPermissions

void setOAuthPermissions(String permissions)
sets the permissions

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

getOAuthAuthorizationURL

String getOAuthAuthorizationURL(String callbackURL)

getOAuthAuthorizationURL

String getOAuthAuthorizationURL(String callbackURL,
                                String state)

getOAuthAccessToken

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

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

getOAuthAccessToken

AccessToken getOAuthAccessToken(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

getOAuthAccessToken

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

Parameters:
oauthCode - OAuth code.
callbackURL - callback URL
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 - access token

getOAuthCallbackURL

String getOAuthCallbackURL()
Sets the access token and callback URL

Returns:
Callback URL

setOAuthCallbackURL

void setOAuthCallbackURL(String callbackURL)
Sets the access token

Parameters:
callbackURL - Callback URL


Copyright © 2014. All Rights Reserved.