[jcifs] JCIFS Authentication on UNIX Box

Michael B Allen ioplex at gmail.com
Thu May 20 11:10:32 MDT 2010


Hi Baba,

This is a simple name service problem. Factor out anything that has to
do with NetBIOS / WINs. Use only DNS and fully qualified DNS names.
That alone will probably resolve the issue.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

On Wed, May 19, 2010 at 8:39 AM, Baba_Bong123 <java.kumarmitra at gmail.com> wrote:
>
> We have an application which was developed in the Windows XP environment. Now
> we have to migrate it to Unix [Solaris] for production. The JCIFS
> authentictaion on LDAP runs fine in the windows environment. But when we are
> using UNIX it is failing and throwing UnknownHostException.  Here is the
> method we are using:
>
>  private boolean authenticateUserOnActiveDirectory(String userName, String
> password){
>        boolean status = false;
>        String ldapEnabled = ApplicationProperties.getProperty("ldap.enabled");
>        if(ldapEnabled.equalsIgnoreCase(LDAP_DISABLED)){
>                log.info("LDAP Diabled?: " + ldapEnabled);
>                return true;
>        }
>
>        /*
>         * Setting the properties of Config.
>         */
>        String defaultDomain =
> ApplicationProperties.getProperty("mpweb.default.domain");
>        UniAddress dc = null;
>        NtlmPasswordAuthentication ntlm = null;
>        Config.setProperty("jcifs.smb.client.soTimeout",
> ApplicationProperties.getProperty("jcifs.smb.client.soTimeout"));
>        Config.setProperty("jcifs.netbios.cachePolicy",
> ApplicationProperties.getProperty("jcifs.netbios.cachePolicy"));
>        Config.setProperty("jcifs.netbios.wins",
> ApplicationProperties.getProperty("jcifs.netbios.wins"));
>        Config.setProperty("jcifs.smb.client.domain",
> ApplicationProperties.getProperty("jcifs.smb.client.domain"));
>        Config.setProperty("jcifs.smb.client.username",
> ApplicationProperties.getProperty("jcifs.smb.client.username"));
>        Config.setProperty("jcifs.smb.client.password",
> ApplicationProperties.getProperty("jcifs.smb.client.password"));
>        ntlm = new NtlmPasswordAuthentication(defaultDomain, userName,
> password);
>        try {
>                        dc = UniAddress.getByName(defaultDomain, true);
>                } catch (UnknownHostException e) {
>                        log.info("Unknown domain {0}: ",defaultDomain);
>                        return status;
>                }
>        try {
>                        SmbSession.logon(dc, ntlm);
>                        status = true;
>                        log.info("LDAP Authentication Passed on OURDOMAIN for user {0}, using
> NTLM with JCIFS.", userName);
>                } catch (SmbException e) {
>                        log.info("Invalid username or password");
>                        return status;
>                }
>        return status;
>    }
>
> we have a properties file which has all configuration properties;
> ########################LDAP PROPERTIES #########################
> ldap.enabled=ENABLED
> jcifs.smb.client.soTimeout=1800000
> jcifs.netbios.cachePolicy=1200
> jcifs.netbios.wins=10.21.18.167,10.21.118.31
> jcifs.smb.client.domain=OURDOMAIN
> jcifs.smb.client.username=USER
> jcifs.smb.client.password=password
> mpweb.default.domain=OURDOMAIN
> ########################LDAP PROPERTIES #########################
>
> The application is deployed on JBoss 5.1.0 GA Application Server.
>
> Does anyone have an idea how to make it work on UNIX?
>
> Thanks & Regards
>
> Baba.
> --
> View this message in context: http://old.nabble.com/JCIFS-Authentication-on-UNIX-Box-tp28607638p28607638.html
> Sent from the Samba - jcifs mailing list archive at Nabble.com.
>
>


More information about the jCIFS mailing list