• 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

spring security form based login using database not responding

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I'm doing spring-security form based validation using database. Its all working if i use Inmemory user n pwd.


if i use last commented code then its work well. but when i use query then nothing happens. only 2 lines shown at jboss console but stil login page remains there. and not allows to me to go my actual page after right unm n pwd. and not even display below code for next any successful/wrong login entry.



again if i write wrong querey intensely then also no sql error shown. Whats wrong here.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For your users-by-username-query and authorities-by-username-query try


 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are facing similar issue.

Is yours working? Please respond ASAP

Thanks
 
Praveen Kondaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My applicationConext-security.xml looks like this.




I am getting following displayed in console. It is not showing any error or stackTrace. I am not sure what i am missing.




My Login.jsp looks like this.



I really apprecieate for quick response.

Thanks Folks
 
Bhukka Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For your authoritiesByUsernameQuery you also need username like the following



 
Bhukka Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bhukka Patel wrote:For your authoritiesByUsernameQuery you also need username like the following



 
Praveen Kondaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bhukka Patel. I apprecieate your help.

Actually it was there. since i was playing with different options, i pasted wrong one.




Anyway, i tried with above configuration. still it is not working. same message in my app server console.



Besides applicationConext-security.xml do i need any other configuration? Am i missing anything?

Your help is greatly apprecieated.

Cheers!!

 
Bhukka Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praveen,

Where is bean:passwordEncoder defined?

Does your database support DECODE function? For purpose of debugging try giving explicit role
 
Praveen Kondaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For now i am not using any passwordEncoder. my password is plain password in database and i am using same password in in my form field.

About your other suggestion, I removed DECODE and tried
 
Bhukka Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is security config file that I use. My filters are auto configured as my security requriements are simple at this point.

 
Praveen Kondaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing your config file.

How is your login.jsp/login.htm looks like. where do you submit?

Thanks
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems Spring Security doesn't check or do anything within the authorities-by-username-query of my security context.xml file. Do I need to explicitly tell it to check? When I intentionally give an invalid table within the users-by-username-query, I do get back errors indicating bad sql but not for the authorities-by-username-query. Did i miss anything? Thanks.

Here is the snippet code in my security context.xml:
 
Ngan Le
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then authentication always fails regardless of whatever login/password I gave, even with the correct login/password.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


complete example here:
[url=
http://j2eeandroid.blogspot.com/2014/12/spring-security.html]
http://j2eeandroid.blogspot.com/2014/12/spring-security.html[/url]
 
reply
    Bookmark Topic Watch Topic
  • New Topic