28 lines
1.8 KiB
HTML
28 lines
1.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
|
|
|
<title>Using getRemoteUser() and getAuthType() methods</title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h4><a name="secgetru"></a>Using getRemoteUser() and getAuthType() methods</h4>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>For both methods, the data returned depends on whether security is enabled in the application server where the servlet is deployed:</p>
|
|
<ul>
|
|
<li>If security is not enabled, a servlet is requested, and the servlet is configured with Web server protection, then the getRemoteUser() method returns the login, and getAuthType() returns the authentication scheme.</li>
|
|
<li>If security is enabled and a servlet is requested, both methods return null when WebSphere protection is not configured for the servlet.</li>
|
|
<li>If security is enabled, a servlet is requested, and the servlet is configured with WebSphere protection, then the getRemoteUser() method returns the login, and the getAuthType() method returns the configured authentication scheme.</li>
|
|
</ul>
|
|
|
|
</body>
|
|
</html>
|