Using getRemoteUser() and getAuthType() methods

Using getRemoteUser() and getAuthType() methods

The getRemoteUser() and getAuthType() methods are methods of the HttpServletRequest interface (javax.servlet.http.HttpServletRequest). If the user has been authenticated, the getRemoteUser() method returns the login of the user making the request. If the user has not been authenticated, the getRemoteUser() method returns null. The getAuthType() method returns the name of the authentication scheme used to protect the servlet (for example, BASIC or SSL) or, if the servlet is not protected, the getAuthType() method returns null.

For both methods, the data returned depends on whether security is enabled in the application server where the servlet is deployed:

Note: Security can be disabled at the application server level (Network Deployment product only) by overriding the global security setting. See Configuring server security for more information.