nerdexam
(ISC)2

CSSLP · Question #41

Which of the following methods does the Java Servlet Specification v2.4 define in the HttpServletRequest interface that control programmatic security? Each correct answer represents a complete solutio

The correct answer is B. isUserInRole() C. getUserPrincipal() D. getRemoteUser(). This question identifies methods within the HttpServletRequest interface of the Java Servlet Specification v2.4 that are specifically designed for programmatic security.

Secure Software Implementation

Question

Which of the following methods does the Java Servlet Specification v2.4 define in the HttpServletRequest interface that control programmatic security? Each correct answer represents a complete solution. Choose all that apply.

Options

  • AgetCallerIdentity()
  • BisUserInRole()
  • CgetUserPrincipal()
  • DgetRemoteUser()

How the community answered

(51 responses)
  • A
    10% (5)
  • B
    90% (46)

Why each option

This question identifies methods within the `HttpServletRequest` interface of the Java Servlet Specification v2.4 that are specifically designed for programmatic security.

AgetCallerIdentity()

`getCallerIdentity()` is not a method defined in the `HttpServletRequest` interface as part of the Java Servlet Specification v2.4 or later versions for programmatic security functionalities.

BisUserInRole()Correct

`isUserInRole()` is used to determine if the authenticated user making the request belongs to a specific security role, facilitating role-based authorization within the application.

CgetUserPrincipal()Correct

`getUserPrincipal()` retrieves the `java.security.Principal` object representing the authenticated user, providing their identity which can be used for further security checks or personalization.

DgetRemoteUser()Correct

`getRemoteUser()` returns the login name of the user making the request if the user has been authenticated, offering a direct way to identify the requesting user.

Concept tested: Java Servlet security methods (HttpServletRequest)

Source: https://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRequest.html

Topics

#Java Servlet Security#Programmatic Security#Authentication#Authorization

Community Discussion

No community discussion yet for this question.

Full CSSLP Practice