Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6973037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:03:23+00:00 2026-05-27T17:03:23+00:00

Please help me out for the below mentioned scenario…. applicationContext-security.xml <authentication-manager> <authentication-provider> <jdbc-user-service data-source-ref=dataSource

  • 0

Please help me out for the below mentioned scenario….

applicationContext-security.xml

<authentication-manager>
  <authentication-provider>
     <jdbc-user-service data-source-ref="dataSource"
         users-by-username-query="SELECT username, password FROM myLibrary.user WHERE username=?" />
  </authentication-provider>
</authentication-manager>

database-end(MySQL)

CREATE TABLE `myLibrary`.`user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
    `enabled` bit(1) DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  `password` varchar(120) DEFAULT NULL,
  `username` varchar(40) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `username` (`username`)
);

xml-user

<user-service>
    <user name="admin" password="amdin" authorities="supervisor, user" />
    <user name="counter1" password="counter1" authorities="user" /> 
</user-service>

“dataSource”; values as perfect too…!!! And there is no exception in any logs….which means library integration is perfect. In fact while using XML based user definitions it works great….but in database access it falis.

My login page sticks to the same; i mean login fails. Pls help friends….!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:03:24+00:00Added an answer on May 27, 2026 at 5:03 pm

    Sorry for the delay….!!! so the problem is at the table responsible for users and that must have to be users. And it’s running awesome…..!!! thanks friends…..thanks a lot…!!!!

    <authentication-manager>   <authentication-provider>      <jdbc-user-service data-source-ref="dataSource"/>   </authentication-provider> </authentication-manager>
    

    Before the above xml-lines; make sure the table for the users must have to be users and also another table authorities must exists with foreign key to users - username. Ok..allow me to put the database part too..!!

    CREATE TABLE `myLibrary`.`users` (     `id` int(11) NOT NULL AUTO_INCREMENT,       `enabled` bit(1) DEFAULT NULL,     `fullName` varchar(255) DEFAULT NULL,     `password` varchar(120) DEFAULT NULL,     `username` varchar(40) NOT NULL,     PRIMARY KEY (`id`),     UNIQUE KEY `id` (`id`),     UNIQUE KEY `username` (`username`)   );
    
    CREATE TABLE `myLibrary`.`authorities` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `authority` varchar(255) NOT NULL,
      `username` varchar(255) NOT NULL,
      `allowed` bit(1) DEFAULT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `id` (`id`),
      KEY `fk_username` (`username`),
      CONSTRAINT `fk_username` FOREIGN KEY (`username`) REFERENCES `users` (`username`) ON DELETE NO ACTION ON UPDATE NO ACTION
    ) ;
    

    Please note that; authorities(allowed) is not mandatory….it’s part of my code..as i want to show the user….all of it’s authorities regardless of it’s permission to use.

    I am using hibernate and so i am getting ID field…and off-course it’s upto you as fas as it’s usability is concerned.

    Have a nice day…!!!!

    🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help me out in the below mentioned situation; My java web application uses
could someone please help me out with the (simplified) code below. I'm trying to
please help me out for the below problem, i am trying since long time(3
I'm a regex newbie, please help me out. The string below occurs in one
Please help me out in the below case: When we clicked on the button
I'm having trouble with some jQuery stuff, please help me out. Below is my
Please help me out with an algorithm for the following problem - Given a
Please help me out on this explode() function issue. I am getting unexpected results
Please help me out here because im getting kind of confused.. I have a
Can someone please help me out with printing the contents of an IFrame via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.