Discussions

Web tier: servlets, JSP, Web frameworks: help needed for NT authentication

  1. help needed for NT authentication (1 messages)

    Hi,

    I am working on a project which requires me to serve a file on NT filesystem based on a user's NT login.I need to serve this file from my servlet. I have the user's NT login stored in the session. Can I somehow query the NT Server and find whether this user has got the required ACL's. The ACL's for the filesystem are set up at the OS level.

    Kindly suggest what needs to be done.
  2. err i kind of found something like this, but for weblogic... dunno if you can use it:

    http://edocs.bea.com/wls/docs61/jcomreference/Security.html

    Here's a rip from this page:

    "Authenticating NT domain/user/passwords from pure Java software

    In order to validate a domain/user/password from a Java program running on a UNIX box (or anywhere) use the static com.bea.jcom.NTLMAuthenticate.validate(...) method.

    This is the Javadoc associated with the method:

    public static void validate(String pdcTcpHost,
    String domain,
    String user,
    String password) throws IOException

    Attempt to authenticate an NT domain/user/password. Works from anywhere that supports Java and requires no native code (just the jcom.jar runtime). No password is transmitted over the network (WebLogic jCOM implements the NT Challenge-Response mechanism). If the domain/user/password are valid then this method simply returns, otherwise a security exception is thrown.

    Parameters:
    pdcTcpHost - the IP name of an NT machine against which WebLogic jCOM can perform the authentication
    domain - the NT Domain name of the user
    user - the NT user name of the user
    password - the user's password

    Throws: SecurityException
    if the domain/user/password are not correct

    Throws: IOException
    if there were problems talking to the NT box against which the authentication was to take place

    Note: This method does not have anything to do with our WebLogic jCOM pure Java-COM bridge, and you never need to call it when using WebLogic jCOM to access COM objects from Java, or the reverse.

    Since we have implemented the NT Challenge-Response mechanism in pure Java as part of our DCOM engine, it was trivial to expose this method, which may be useful.
    "