QuestionQ29

Secure Software Implementation

Which methods in the Java Servlet Specification v2.4 are defined in the HttpServletRequest interface for programmatic security? Each correct answer represents a complete solution. Choose all that apply.

Choose three
  • A getCallerIdentity()
  • B isUserInRole()
  • C getUserPrincipal()
  • D getRemoteUser()
Explanation

HttpServletRequest provides getRemoteUser() to obtain the authenticated user name, getUserPrincipal() to obtain the authenticated caller’s Principal, and isUserInRole(String) to test whether that caller belongs to a logical role. These are the interface’s programmatic security methods; getCallerIdentity() is not defined by the Servlet API.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!