This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use Spring with LDAP

 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problem that how to use spring using LDAP. I want to create user role I write following code but I think I write wrong code
can anyone please tell me correct wat that can be helpful for me.
// configuration file
















 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you seem to be getting back are basic attributes of the user.

Do you want a Spring ROLE, or LDAP group memberships? (In Active Directory this is "memberOf")

WP
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply. Actually I want LDAP group membership .My project is I have one form and user will register as user and he will select his role ,after selecting role admin will authenticate thats it.
means i want to separate all admin role and user or student role separate .Thank you.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring Security does a lot of the heavy lifting for you.

Have a look at This blog post on the subject.
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem is that how to check login user is admin or user from the db and is their any way to store user information at the time of signup in ldap server and after login how to redirect login user to his page which is
declared in configuration file.

 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think for the type of scenarios you are describing that LDAP is probably not your best choice. You will have to explain more what your requirements are and also why you want to use LDAP.
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi bill my problem is that i have created separate pages for each user for eg. after login normal user will see his user page, after login admin will see his admin page like that for all users
i have created different pages and I want ti create users group and after login he/she will see his pages that's all
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any way to store user information at the time of signup in ldap server


Not that it could not be done but it typically is not. Usually LDAP stores things like a phone book, or maybe a business will store all of its employees and assign them roles there. Entries are typically added by an LDAP administrator and applications such as yours just look things up. I guess my question is do you have a requirement to use LDAP? Is there an LDAP server already existing with roles you need to access? It just sounds to me like maybe a DB would be a better fit for you.
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. When I am creating group it gives me following error :


my code is :

and this is my Person class:

and this is my conf. file
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error you get is because the server can't find the parent node of the entry you are trying to create. Since you have included the base DN in your configuration you must not include it in any other DN's.

change



to

 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill, I have changed my code whatever you gave in post but still it gives me following error :

Again i post my new edited code :

xml file :





 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic