Class FileAuthenticationManager
java.lang.Object
cloud.piranha.extension.security.file.FileAuthenticationManager
- All Implemented Interfaces:
AuthenticationManager
The file-based authentication manager.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSecurityMapping
(String urlPattern) Add security mapping.boolean
authenticate
(HttpServletRequest request, HttpServletResponse response) Authenticate the request.void
login
(HttpServletRequest request, String username, String password) Login.void
logout
(HttpServletRequest request, HttpServletResponse response) Logout.boolean
needsAuthentication
(HttpServletRequest request) Determine if the request needs authentication.void
requestAuthentication
(HttpServletRequest request, HttpServletResponse response) Request authentication.
-
Constructor Details
-
FileAuthenticationManager
Constructor.- Parameters:
usersFile
- the users file.
-
-
Method Details
-
addSecurityMapping
Description copied from interface:AuthenticationManager
Add security mapping.- Specified by:
addSecurityMapping
in interfaceAuthenticationManager
- Parameters:
urlPattern
- the URL pattern.
-
authenticate
public boolean authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Description copied from interface:AuthenticationManager
Authenticate the request.- Specified by:
authenticate
in interfaceAuthenticationManager
- Parameters:
request
- the request.response
- the response.- Returns:
- true if authenticated.
- Throws:
IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
login
public void login(HttpServletRequest request, String username, String password) throws ServletException Description copied from interface:AuthenticationManager
Login.- Specified by:
login
in interfaceAuthenticationManager
- Parameters:
request
- the request.username
- the username.password
- the password.- Throws:
ServletException
- when a Servlet error occurs.
-
logout
public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException Description copied from interface:AuthenticationManager
Logout.- Specified by:
logout
in interfaceAuthenticationManager
- Parameters:
request
- the request.response
- the response.- Throws:
ServletException
- when a Servlet error occurs.
-
needsAuthentication
Description copied from interface:AuthenticationManager
Determine if the request needs authentication.- Specified by:
needsAuthentication
in interfaceAuthenticationManager
- Parameters:
request
- the request.- Returns:
- true if it does, false otherwise.
-
requestAuthentication
Description copied from interface:AuthenticationManager
Request authentication.- Specified by:
requestAuthentication
in interfaceAuthenticationManager
- Parameters:
request
- the request.response
- the response.
-