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 7926857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:59:17+00:00 2026-06-03T18:59:17+00:00

I am trying to use Spring Security 3.1 in my web app. I have

  • 0

I am trying to use Spring Security 3.1 in my web app. I have started off with following this particular tutorial.

I am using the technique used here where in authentication provider is a datasource

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

           users-by-username-query="
              select email,password 
              from usr where email=?" 

           authorities-by-username-query="
              select u.email, ur.authority from usr u, usr_roles ur 
              where u.usr_id = ur.usr_id and u.email =?  " 

        />
    </authentication-provider>
</authentication-manager>

So if you notice I am using the email as my username and I do not have a enabled column.

This does not seem to work.

My login form looks like

<form name="f" action="<c:url value="j_spring_security_check" />" method="POST">
    <table>
        <tr>
        <td>User:</td>
        <td><input type="text" name="j_username" value=""></td>
        </tr>
        <tr>
        <td>Password:</td>
        <td><input type="password" name="j_password" />
        </td>
        </tr>
        <tr>
        <td colspan="2">
                <input name="submit" type="submit" value="submit" />
            </td>
        </tr>
        <tr>
        <td colspan="2">
                <input name="reset" type="reset" />
        </td>
        </tr>
    </table>
</form>

Please advise as to how to get this working or am I missing something ?

  • 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-06-03T18:59:18+00:00Added an answer on June 3, 2026 at 6:59 pm

    I managed to solve it myself. I have modified the authentication-manager configuration as follows

    <authentication-manager>
          <authentication-provider>
    
                <jdbc-user-service data-source-ref="dataSource"
    
               users-by-username-query="
                  select * from (select email as username,password,1 as enabled 
                  from usr) where username=?" 
    
               authorities-by-username-query="
                 select * from
                (select u.email username, ur.authority AUTHORITY 
                from usr u, usr_role ur 
                  where u.usr_id = ur.usr_id) where  username = ? " 
    
            />
          </authentication-provider>
        </authentication-manager>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to autowire JdbcUserDetailsManager from Spring Security, I use following statement in appcontext.xml
I am currently working on securing a web application using spring-security 3.0. I have
I'm trying to secure my Spring 3.1 web app with Spring Security 3.1, and
I'm trying to make a simple username/password authentication in a Spring Security web app.
I am trying to use Spring Security 3.0.5 in my web application. Basically, I
I'm trying to use the spring-security-core database request map config and it doesn't seem
I have a Spring MVC application trying to use a rich domain model, with
I am writing a web app in Grails with the Acegi/Spring Security plug-in, and
I am trying to use PreAuthFilter (for Siteminder) with Spring Security 3.0. <http use-expressions=true>
I'm using Spring 3.0.3 with Spring Security. So, I have fairly lenient restrictions on

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.