[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1445
  • Last Modified:

Ldap authentication

Hi!
I´m trying to authenticate in a domain using java and ldap.

  public boolean connect( String username, String password )
    throws Exception {
    try  {
        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, LDAPCTXFACTORY);
        env.put(Context.PROVIDER_URL, url);
        env.put(Context.SECURITY_AUTHENTICATION, AUTHENTICATION_SIMPLE);
        env.put(Context.SECURITY_CREDENTIALS, password);
        env.put(Context.SECURITY_PRINCIPAL, username + "@" + domain);
        dirContext = new javax.naming.directory.InitialDirContext(env);    
        return true;
    } catch ( NamingException e )  {
        System.out.println("error: " + e.getMessage());
         return false;
    } catch ( Exception e )  {
        throw new Exception ("ERROR-LDAP: Error autenticando " + username +"/"
        + password + " " + e.getMessage(), e);
    }          
  }

where url:
url = "ldap://" + host + ":" + port + "/";

When I execute the code I get this error:

[LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 531, v893 ]

I know that this error is because the user cant logon in all domain computers.
I cant change this property and I want to know if there is a solution for this problem and how can I fix it.
0
olgavillamizar
Asked:
olgavillamizar
  • 4
  • 3
1 Solution
 
objectsCommented:
you need to either changer the user/pass to one that has permissions
or give that user the required permissions
0
 
olgavillamizarAuthor Commented:
but I cant do it....because the network politics cant be changed
0
 
objectsCommented:
then theres nothing u can do by the sounds of it. sorry :(
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
olgavillamizarAuthor Commented:
Ok...
I run the browser in my computer.
The application is in a server and the domain server is another server.

If I will can change the permissions, where I have to do?

Thanks
0
 
objectsCommented:
> If I will can change the permissions, where I have to do?

On the server you are trying to login to
0
 
olgavillamizarAuthor Commented:
Which Server??
Domain Server or Application Server?
0
 
objectsCommented:
domain
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now