public interface OAuthService
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getAuthorizedScopes(java.lang.String... scopes)
Return authorized scopes from input scopes.
|
java.lang.String |
getClientId(java.lang.String... scopes)
Returns the client_id from oauth2 request.
|
java.lang.String |
getClientId(java.lang.String scope)
Returns the client_id from oauth2 request.
|
User |
getCurrentUser()
Returns the
User on whose behalf the request was made. |
User |
getCurrentUser(java.lang.String... scopes)
Returns the
User on whose behalf the request was made. |
User |
getCurrentUser(java.lang.String scope)
Returns the
User on whose behalf the request was made. |
java.lang.String |
getOAuthConsumerKey()
Deprecated.
OAuth1 is no longer supported
|
boolean |
isUserAdmin()
Returns true if the user on whose behalf the request was made is an admin
for this application, false otherwise.
|
boolean |
isUserAdmin(java.lang.String... scopes)
Returns true if the user on whose behalf the request was made is an admin
for this application, false otherwise.
|
boolean |
isUserAdmin(java.lang.String scope)
Returns true if the user on whose behalf the request was made is an admin
for this application, false otherwise.
|
User getCurrentUser() throws OAuthRequestException
User
on whose behalf the request was made.OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.User getCurrentUser(java.lang.String scope) throws OAuthRequestException
User
on whose behalf the request was made.scope
- The custom OAuth scope that is accepted.OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.User getCurrentUser(java.lang.String... scopes) throws OAuthRequestException
User
on whose behalf the request was made.scopes
- The custom OAuth scopes at least one of which is accepted.OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.boolean isUserAdmin() throws OAuthRequestException
OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.boolean isUserAdmin(java.lang.String scope) throws OAuthRequestException
scope
- The custom OAuth scope that is accepted.OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.boolean isUserAdmin(java.lang.String... scopes) throws OAuthRequestException
scopes
- The custom OAuth scopes at least one of which is accepted.OAuthRequestException
- If the request was not a valid OAuth request.OAuthServiceFailureException
- If an unknown OAuth error occurred.@Deprecated java.lang.String getOAuthConsumerKey() throws OAuthRequestException
OAuthRequestException
java.lang.String getClientId(java.lang.String scope) throws OAuthRequestException
OAuthRequestException
- If the request was not a valid OAuth2 request.OAuthServiceFailureException
- If an unknown OAuth error occurred.java.lang.String getClientId(java.lang.String... scopes) throws OAuthRequestException
scopes
- The custom OAuth scopes at least one of which is accepted.OAuthRequestException
- If the request was not a valid OAuth2 request.OAuthServiceFailureException
- If an unknown OAuth error occurred.java.lang.String[] getAuthorizedScopes(java.lang.String... scopes) throws OAuthRequestException
scopes
- The custom OAuth scopes at least one of which is accepted.OAuthRequestException
- If the request was not a valid OAuth2 request.OAuthServiceFailureException
- If an unknown OAuth error occurred.