Package com.google.appengine.api.oauth
Interface OAuthService
-
public interface OAuthServiceThe OAuthService provides methods useful for validating OAuth requests.- See Also:
- RFC 5849 for the OAuth specification.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description String[]getAuthorizedScopes(String... scopes)Return authorized scopes from input scopes.StringgetClientId(String scope)Returns the client_id from oauth2 request.StringgetClientId(String... scopes)Returns the client_id from oauth2 request.UsergetCurrentUser()Returns theUseron whose behalf the request was made.UsergetCurrentUser(String scope)Returns theUseron whose behalf the request was made.UsergetCurrentUser(String... scopes)Returns theUseron whose behalf the request was made.StringgetOAuthConsumerKey()Deprecated.OAuth1 is no longer supportedbooleanisUserAdmin()Returns true if the user on whose behalf the request was made is an admin for this application, false otherwise.booleanisUserAdmin(String scope)Returns true if the user on whose behalf the request was made is an admin for this application, false otherwise.booleanisUserAdmin(String... scopes)Returns true if the user on whose behalf the request was made is an admin for this application, false otherwise.
-
-
-
Method Detail
-
getCurrentUser
User getCurrentUser() throws OAuthRequestException
Returns theUseron whose behalf the request was made.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
getCurrentUser
User getCurrentUser(String scope) throws OAuthRequestException
Returns theUseron whose behalf the request was made.- Parameters:
scope- The custom OAuth scope that is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
getCurrentUser
User getCurrentUser(String... scopes) throws OAuthRequestException
Returns theUseron whose behalf the request was made.- Parameters:
scopes- The custom OAuth scopes at least one of which is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
isUserAdmin
boolean isUserAdmin() throws OAuthRequestExceptionReturns true if the user on whose behalf the request was made is an admin for this application, false otherwise.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
isUserAdmin
boolean isUserAdmin(String scope) throws OAuthRequestException
Returns true if the user on whose behalf the request was made is an admin for this application, false otherwise.- Parameters:
scope- The custom OAuth scope that is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.- Since:
- App Engine 1.7.3.
-
isUserAdmin
boolean isUserAdmin(String... scopes) throws OAuthRequestException
Returns true if the user on whose behalf the request was made is an admin for this application, false otherwise.- Parameters:
scopes- The custom OAuth scopes at least one of which is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
getOAuthConsumerKey
@Deprecated String getOAuthConsumerKey() throws OAuthRequestException
Deprecated.OAuth1 is no longer supportedThrows OAuthRequestException- Throws:
OAuthRequestException
-
getClientId
String getClientId(String scope) throws OAuthRequestException
Returns the client_id from oauth2 request.- Throws:
OAuthRequestException- If the request was not a valid OAuth2 request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
getClientId
String getClientId(String... scopes) throws OAuthRequestException
Returns the client_id from oauth2 request.- Parameters:
scopes- The custom OAuth scopes at least one of which is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth2 request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
getAuthorizedScopes
String[] getAuthorizedScopes(String... scopes) throws OAuthRequestException
Return authorized scopes from input scopes.- Parameters:
scopes- The custom OAuth scopes at least one of which is accepted.- Throws:
OAuthRequestException- If the request was not a valid OAuth2 request.OAuthServiceFailureException- If an unknown OAuth error occurred.
-
-