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 extendTokenExpiration()
          Extends this instance's short-lived-token expiration.
 AccessToken extendTokenExpiration(String shortLivedToken)
          Extends the short-lived-token expiration.
 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 getOAuthAccessTokenInfo()
          Returns the access token information.
 AccessToken getOAuthAccessTokenInfo(String accessToken)
          Returns the access token information.
 AccessToken getOAuthAppAccessToken()
          Returns an App Access Token.
 String getOAuthAuthorizationURL(String callbackURL)
           
 String getOAuthAuthorizationURL(String callbackURL, AuthOption authOption)
           
 String getOAuthAuthorizationURL(String callbackURL, String state)
           
 String getOAuthCallbackURL()
          Sets the access token and callback URL
 DeviceCode getOAuthDeviceCode()
          Returns a generated device code.
 AccessToken getOAuthDeviceToken(DeviceCode deviceCode)
          Returns a Device Access Token.
 String getOAuthReAuthenticationURL(String callbackURL, String nonce)
          Returns the URL that asks the person to re-authenticate unconditionally.
 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)

getOAuthAuthorizationURL

String getOAuthAuthorizationURL(String callbackURL,
                                AuthOption authOption)

getOAuthReAuthenticationURL

String getOAuthReAuthenticationURL(String callbackURL,
                                   String nonce)
Returns the URL that asks the person to re-authenticate unconditionally.

Parameters:
callbackURL - callback url
nonce - a completely arbitrary alphanumeric code that your app generates. see: The auth_nonce parameter
Returns:
the url for re-authenticate
See Also:
Re-authentication - Facebook Login

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

getOAuthDeviceCode

DeviceCode getOAuthDeviceCode()
                              throws FacebookException
Returns a generated device code.

Returns:
Device code
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Facebook Login for Devices

getOAuthDeviceToken

AccessToken getOAuthDeviceToken(DeviceCode deviceCode)
                                throws FacebookException
Returns a Device Access Token.

Returns:
Device Acceess Token
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Facebook Login for Devices

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

extendTokenExpiration

AccessToken extendTokenExpiration(String shortLivedToken)
                                  throws FacebookException
Extends the short-lived-token expiration.

Parameters:
shortLivedToken - access token
Returns:
extended access token
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Expiration and Extension of Access Tokens - Facebook Login

extendTokenExpiration

AccessToken extendTokenExpiration()
                                  throws FacebookException
Extends this instance's short-lived-token expiration.

Returns:
extended access token
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized
See Also:
Expiration and Extension of Access Tokens - Facebook Login

getOAuthAccessTokenInfo

AccessToken getOAuthAccessTokenInfo(String accessToken)
                                    throws FacebookException
Returns the access token information.

Parameters:
accessToken - access token
Returns:
access token information
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized

getOAuthAccessTokenInfo

AccessToken getOAuthAccessTokenInfo()
                                    throws FacebookException
Returns the access token information.

Returns:
access token information
Throws:
FacebookException - when Facebook service or network is unavailable, or the user has not authorized


Copyright © 2019. All rights reserved.