• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

customized authentication provider

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new in spring security. I have to implement login option using spring security (using Hibernate Annotation). I have InnoDB supports for MySQL DB. My employee login tables are..
1. tbl_employee[emp_no bigint primary key, password varchar(20), authority_id int]
2. tbl_authority[authority_id (foreign key of same in tbl_employee), authority_name varchar(50)]
3. tbl_profile[emp_no(foreign key of same in tbl_employee), office_name varchar(100)]

My doubt is how to make one-to-many relation from tbl_employee table towards tbl_profile table to get the proper office_name after the successful login. We are using myeclipse for spring scaffolding to generate mvc and spring security code. On that users, users_authorities, and authorities table on security scaffolding. We have to replace that with above 3 tables. Can anybody help me with sample source code. Sent to my gmail accnt ajesh123.
Posts: 17347
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My article here might help.


Basically a UserDetailsService object is the one that does the querying to your database. It has one method loadUserByUserName(String userName) It returns a UserDetails object. So you can take the username and do any type of querying you want in your UserDetailsService implementation, if the ones that Spring created doesn't work for you.

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic