java.lang.Object
cloud.piranha.core.impl.DefaultSecurityManager
- All Implemented Interfaces:
SecurityManager
The default SecurityManager.
This SecurityManager is securing nothing.
- Author:
- Manfred Riem ([email protected])
-
Nested Class Summary
Nested classes/interfaces inherited from interface cloud.piranha.core.api.SecurityManager
SecurityManager.AuthenticateSource, SecurityManager.UsernamePasswordLoginHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Authenticate the request.void
declareRoles
(String[] roles) Declare roles.getRoles()
Get the declared rolesGet the web application.boolean
isUserInRole
(jakarta.servlet.http.HttpServletRequest request, String role) Is the user in the specific role.void
Login.void
logout
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Logout.void
setWebApplication
(WebApplication webApplication) Set the web application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cloud.piranha.core.api.SecurityManager
authenticate, declareRoles, getAuthenticatedRequest, getAuthenticatedResponse, getAuthMethod, getDenyUncoveredHttpMethods, getFormErrorPage, getFormLoginPage, getRealmName, isCallerAuthorizedForResource, isRequestedResourcePublic, isRequestSecurityAsRequired, postRequestProcess, setAuthMethod, setDenyUncoveredHttpMethods, setFormErrorPage, setFormLoginPage, setRealmName, setUsernamePasswordLoginHandler
-
Constructor Details
-
DefaultSecurityManager
public DefaultSecurityManager()
-
-
Method Details
-
authenticate
public boolean authenticate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException Description copied from interface:SecurityManager
Authenticate the request.- Specified by:
authenticate
in interfaceSecurityManager
- Parameters:
request
- the request.response
- the response.- Returns:
- true if authenticated.
- Throws:
IOException
- when an I/O error occurs.jakarta.servlet.ServletException
- when a servlet error occurs.
-
declareRoles
Description copied from interface:SecurityManager
Declare roles.- Specified by:
declareRoles
in interfaceSecurityManager
- Parameters:
roles
- the roles.
-
getRoles
Description copied from interface:SecurityManager
Get the declared roles- Specified by:
getRoles
in interfaceSecurityManager
- Returns:
- the roles
-
getWebApplication
Description copied from interface:SecurityManager
Get the web application.- Specified by:
getWebApplication
in interfaceSecurityManager
- Returns:
- the web application.
-
isUserInRole
Description copied from interface:SecurityManager
Is the user in the specific role.- Specified by:
isUserInRole
in interfaceSecurityManager
- Parameters:
request
- the request.role
- the role.- Returns:
- true if in the role, false otherwise.
-
login
public void login(jakarta.servlet.http.HttpServletRequest request, String username, String password) throws jakarta.servlet.ServletException Description copied from interface:SecurityManager
Login.- Specified by:
login
in interfaceSecurityManager
- Parameters:
request
- the request.username
- the username.password
- the password.- Throws:
jakarta.servlet.ServletException
- when unable to login.
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException Description copied from interface:SecurityManager
Logout.- Specified by:
logout
in interfaceSecurityManager
- Parameters:
request
- the request.response
- the response.- Throws:
jakarta.servlet.ServletException
- when a servlet error occurs.
-
setWebApplication
Description copied from interface:SecurityManager
Set the web application.- Specified by:
setWebApplication
in interfaceSecurityManager
- Parameters:
webApplication
- the web application.
-