@HTTPService(name="facebook") public class FacebookUserService extends java.lang.Object
Constructor and Description |
---|
FacebookUserService() |
Modifier and Type | Method and Description |
---|---|
Response |
authorize(AuthenticationParameter authenticatedUser,
StringParameter redirectUri)
This method can be used to grant the service access to the authenticated user's Facebook account.
|
Response |
login(AuthenticationParameter authenticatedUser,
StringParameter accessToken)
This method can be used to authenticate the user using Facebook credentials.
|
Response |
oAuth2Callback(StringParameter authorizationCode,
StringParameter errorCode,
StringParameter nonce)
This method is called by Facebook after user has either denied or granted the service permission to his/her Facebook account, and is not meant to be used directly by the end-users.
|
Response |
register(StringParameter accessToken)
This method can be used to register a new user using a Facebook account.
|
Response |
unauthorize(AuthenticationParameter authenticatedUser)
This method allows a user to revoke the previously given authorization permissions.
|
public FacebookUserService()
@HTTPServiceMethod(name="oAuth2callback") public Response oAuth2Callback(@HTTPMethodParameter(name="code",required=false) StringParameter authorizationCode, @HTTPMethodParameter(name="error",required=false) StringParameter errorCode, @HTTPMethodParameter(name="state") StringParameter nonce)
authorizationCode
- OAuth2 authorization code generated by Facebook.errorCode
- Optional error message as reported by Facebook.nonce
- Short-lived nonce value randomly generated by the authorization process.@HTTPServiceMethod(name="login") public Response login(@HTTPAuthenticationParameter(required=false) AuthenticationParameter authenticatedUser, @HTTPMethodParameter(name="access_token") StringParameter accessToken)
authenticatedUser
- accessToken
- OAuth2 access token as provided by Facebook.@HTTPServiceMethod(name="register") public Response register(@HTTPMethodParameter(name="access_token") StringParameter accessToken)
accessToken
- OAuth2 access token as provided by Facebook@HTTPServiceMethod(name="authorize") public Response authorize(@HTTPAuthenticationParameter AuthenticationParameter authenticatedUser, @HTTPMethodParameter(name="fb_redirect_uri",required=false) StringParameter redirectUri)
authenticatedUser
- redirectUri
- The final target, where the user should be redirected to after successful authorization. If not given, a default status message will be shown.@HTTPServiceMethod(name="unauthorize") public Response unauthorize(@HTTPAuthenticationParameter AuthenticationParameter authenticatedUser)
authenticatedUser
- Copyright © 2015 Tampere University of Technology, Pori Department.