How to perform integrated Windows authentication (IWA) in a scala play web application

I tried very hard to familiarize myself with the various authentication protocols for Windows (NTLM v1, NTLM v2, Keberos, LDAP ..) and based on this understanding, I believe that NTLM (v1 / 2) should be the target implementation.

I have a simple web application developed in Scala Play for which I would like it to have a login feature based on user credentials (manually or through an existing workstation session).

Having said that, I'm struggling to get it to work. I found several libraries on the Internet that are mostly poorly documented, while others are commercial.

A simple example or resource on how to make it work will be very useful.

+4
source share
1 answer

You can try JCIFS code samples as follows:

        Config.setProperty("jcifs.smb.client.connTimeout", "1000");
        InetAddress ip = InetAddress.getByName("domainControler"); 
        UniAddress myDomain = new UniAddress(ip);
        NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("domain_name", user_name, password);
        try{
            SmbSession.logon(myDomain, auth);
        }catch(Exception sme){
            //Login failed.
        }
+2
source

Source: https://habr.com/ru/post/1618299/


All Articles