network management functions are very useful function to integrate your software with the network services such directory services (LDAP) etc.
In my case i used the LogonUser API to check a valid user/password of a user against the AD, and than i used NetUserGetLocalGroups api to check a valid group to the specific user.
of course you can do it as well with the ADSI api , but i found this easier to use.
note:
your running process should have permission to get the user groups.
Yaniv T
This Blog is first of all memos for me!! From time to time I get exposed to new and cool stuff for developers and architects ,most of the time its a solution for a problem or tips or tricks, so, I would like to track my memos and share it with you, it can save your time and nervous, I hope you will enjoy it - by Yaniv Tzanany.
Search This Blog
Showing posts with label LDAP. Show all posts
Showing posts with label LDAP. Show all posts
Sunday, June 20, 2010
Wednesday, December 10, 2008
LDAP error code
i used LDAP authentication via java , in case of wrong user name or password you get an exception of type AuthenticationException, as you guess in ldap Authentication there could be more than one reason ( not just wrong pwd or user) it could be account is locked , not allowed this time, etc.
i found a list that can help to understand the reason in case you need it:
525 - user not found
52e - invalid credentials
530 - not permitted to logon at this time
531 - not permitted to logon from this workstation
532 - password expired
533 - account disabled
701 - account expired
773 - user must reset password
775 - account locked
more details for the code above you can find here Active Directory LDAP Errors.
i found a list that can help to understand the reason in case you need it:
525 - user not found
52e - invalid credentials
530 - not permitted to logon at this time
531 - not permitted to logon from this workstation
532 - password expired
533 - account disabled
701 - account expired
773 - user must reset password
775 - account locked
more details for the code above you can find here Active Directory LDAP Errors.
Monday, November 10, 2008
LDAP with java
i found very interesting articles and sample to deal with LDAP via java code .
one of the complete and best sample you can find here - This is sample program that show how to authenticate with for example a Windows Active Directory:
Active Directory LDAP and Java.
second there is a very good tutorial for JNDI & Ldap that you can find here:
Your guide to The JNDI Tutorial .
another good link with java/c#/c samples -> A Beginner's Guide to LDAP Development
a very good book you can find here LDAP-Programming-With-Java
And here is a tip to find all the ldap attributes:
To discover more LDAP attributes, go to the command prompt, type:
CSVDE -f Exportfile.csv. Then open Exportfile.csv with Excel.exe.
Alternatively, use ADSI Edit and right click the container objects.
enjoy
one of the complete and best sample you can find here - This is sample program that show how to authenticate with for example a Windows Active Directory:
Active Directory LDAP and Java.
second there is a very good tutorial for JNDI & Ldap that you can find here:
Your guide to The JNDI Tutorial .
another good link with java/c#/c samples -> A Beginner's Guide to LDAP Development
a very good book you can find here LDAP-Programming-With-Java
And here is a tip to find all the ldap attributes:
To discover more LDAP attributes, go to the command prompt, type:
CSVDE -f Exportfile.csv. Then open Exportfile.csv with Excel.exe.
Alternatively, use ADSI Edit and right click the container objects.
enjoy
Subscribe to:
Posts (Atom)