Package thredds.servlet.restrict
Class TomcatAuthorizer
java.lang.Object
thredds.servlet.restrict.TomcatAuthorizer
- All Implemented Interfaces:
Authorizer
- Direct Known Subclasses:
CAMSAuthorizer
Use Tomcat security.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthorize(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String role) Decide is this request is authorized in the named role.voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) Process this request.voidSet the role source, if there is one.voidsetSslPort(String sslPort) voidsetUseSSL(boolean useSSL)
-
Constructor Details
-
TomcatAuthorizer
public TomcatAuthorizer()
-
-
Method Details
-
setUseSSL
public void setUseSSL(boolean useSSL) -
setSslPort
-
setRoleSource
Description copied from interface:AuthorizerSet the role source, if there is one. If not, assume no role authentication is needed. use RoleSource.hasRole() to test for role.- Specified by:
setRoleSourcein interfaceAuthorizer- Parameters:
db- tells whether a user has the named role.
-
authorize
public boolean authorize(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String role) throws IOException Description copied from interface:AuthorizerDecide is this request is authorized in the named role. This method must be thread-safe.- Specified by:
authorizein interfaceAuthorizer- Parameters:
req- the requestres- the responserole- need this role- Returns:
- true if user is authenticated. if false, must set res.setStatus().
- Throws:
IOException- I/O error, eg network
-
doGet
public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws jakarta.servlet.ServletException, IOException Description copied from interface:AuthorizerProcess this request. May be a no-op.- Specified by:
doGetin interfaceAuthorizer- Parameters:
req- the requestres- the response- Throws:
jakarta.servlet.ServletException- other errorsIOException- I/O error, eg network
-