• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to use Spring with LDAP

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
















 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :





 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic