Package x.oauth
Class ScopeService
java.lang.Object
x.oauth.ScopeService
Responsible for storing and loading OAuth20 scopes.
- Author:
- sakdsitt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteScope(String scopeName) Deletes a scope.protected List<ApplicationInfo> getClientAppsByScope(String scopeName) getExpiresIn(String tokenGrantType, String scope) Returns value for expires_in by given scope and token type.getScopeByName(String scopeName) protected StringgetScopes(javax.servlet.http.HttpServletRequest req) Returns either all scopes or scopes for a specific client_id passed as query parameter.getValidScope(String scope, String clientId) Checks whether a scope is valid for a given client id.getValidScopeByScope(String scope, String storedScope) loadScopes(String scope) registerScope(javax.servlet.http.HttpServletRequest req) Register an oauth scope.booleanscopeAllowed(String scope, String allowedScopes) Checks whether a scope is contained in allowed scopes.protected voidsetScopeEmptyValues(Scope scope, Scope foundScope) updateScope(javax.servlet.http.HttpServletRequest req, String scopeName) Updates a scope.
-
Field Details
-
MANDATORY_FIELDS_ERROR
- See Also:
-
MANDATORY_SCOPE_ERROR
- See Also:
-
SCOPE_NAME_INVALID_ERROR
- See Also:
-
SCOPE_STORED_OK_MESSAGE
- See Also:
-
SCOPE_STORED_NOK_MESSAGE
- See Also:
-
SCOPE_UPDATED_OK_MESSAGE
- See Also:
-
SCOPE_UPDATED_NOK_MESSAGE
- See Also:
-
SCOPE_NOT_EXIST
- See Also:
-
SCOPE_ALREADY_EXISTS
- See Also:
-
SCOPE_DELETED_OK_MESSAGE
- See Also:
-
SCOPE_DELETED_NOK_MESSAGE
- See Also:
-
SCOPE_USED_BY_APP_MESSAGE
- See Also:
-
-
Constructor Details
-
ScopeService
public ScopeService()
-
-
Method Details
-
registerScope
public String registerScope(javax.servlet.http.HttpServletRequest req) throws OAuthException, IOException Register an oauth scope. If the scope already exists, returns an error.- Throws:
OAuthExceptionIOException
-
getScopes
Returns either all scopes or scopes for a specific client_id passed as query parameter.- Throws:
OAuthException
-
getValidScope
Checks whether a scope is valid for a given client id. -
getValidScopeByScope
-
scopeAllowed
Checks whether a scope is contained in allowed scopes. -
getExpiresIn
Returns value for expires_in by given scope and token type. -
updateScope
public String updateScope(javax.servlet.http.HttpServletRequest req, String scopeName) throws OAuthException Updates a scope. If the scope does not exists, returns an error.- Throws:
OAuthException
-
deleteScope
Deletes a scope. If the scope does not exists, returns an error.- Throws:
OAuthException
-
getScopeByName
- Throws:
OAuthException
-
getClientAppsByScope
-
setScopeEmptyValues
-
loadScopes
-
getScopes
- Throws:
OAuthException
-