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: