@HTTPService(name="google") public class GoogleUserService extends java.lang.Object
Constructor and Description |
---|
GoogleUserService() |
Modifier and Type | Method and Description |
---|---|
Response |
authorize(AuthenticationParameter authenticatedUser)
This method can be used to grant the service access to the authenticated user's Google account.
|
Response |
login(AuthenticationParameter authenticatedUser,
StringParameter accessToken)
This method can be used to authenticate the user using Google credentials.
|
Response |
oAuth2Callback(StringParameter authorizationCode,
StringParameter errorCode,
StringParameter nonce)
This method is called by Google after user has either denied or granted the service permission to his/her Google 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 Google account.
|
Response |
unauthorize(AuthenticationParameter authenticatedUser)
This method allows a user to revoke the previously given authorization permissions.
|
public GoogleUserService()
@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 Google.errorCode
- Optional error message as reported by Google.nonce
- Short-lived nonce value randomly generated by the authorization process.@HTTPServiceMethod(name="unauthorize") public Response unauthorize(@HTTPAuthenticationParameter AuthenticationParameter authenticatedUser)
authenticatedUser
- @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 Google.@HTTPServiceMethod(name="register") public Response register(@HTTPMethodParameter(name="access_token") StringParameter accessToken)
accessToken
- OAuth2 access token as provided by Google.@HTTPServiceMethod(name="authorize") public Response authorize(@HTTPAuthenticationParameter AuthenticationParameter authenticatedUser)
authenticatedUser
- Copyright © 2015 Tampere University of Technology, Pori Department.