简体   繁体   中英

Checking if LDAP authentication is enabled in WebSphere

I have some WebSphere instances for which Active Directory has been connected for LDAP authentication, and some where it has not.

I have a servlet to handle authentication. It calls httpServletRequest.getRemoteUser() and checks whether this is null . This works when deployed to LDAP enabled servers, but on instances where LDAP is not enabled (like developer workstations) it means that the user is never authenticated.

How can I programmatically check whether LDAP is enabled in the container?

THe App Server's do not care about the registry be it a LDAP Server, database or something else.

If the security is not turned on in the server, then it will always return null as the user has not been authenticated.

As suggested by home , you should turn on security with say the default file registry if you want the user name in the dev environments.

The specs state this:

http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html

getRemoteUser

java.lang.String getRemoteUser() Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER. Returns: a String specifying the login of the user making this request, or null if the user login is not known

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM