Quantcast

Problem to connect with Spring Security Core plugin with user created from DB

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem to connect with Spring Security Core plugin with user created from DB

Raja CHARFI
Hello,

I am working with two grails applications using grails 2.3.6 and Spring Security Core plugin 1.2.7.3

I have created new User using SQL request in my service in my first application, then I am trying to connect with that User in my second application but I have always the same message "Sorry, username or password doesn’t exist".
When I am trying to catch Type of exception I get this exception "BadCredentialsException".
But when I am executing "User.list()" from console I have that user with that the same username and password.

I don't understand where is the problem because I have really the correct User in my Data base.

Please any one have the same problem or can help me.
Thanks :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem to connect with Spring Security Core plugin with user created from DB

hblask
Can you read the password in the database?   If so, that may be your problem.  I think, by default, the plugin will use SHA-256 to encrypt the password.   So if you put a plain text password in the database, when you log in, you will be comparing a SHA-256 password vs plain text.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem to connect with Spring Security Core plugin with user created from DB

Raja CHARFI
Yes I can read my password and when I execute decoding password By console I have the same password I was entry.
In my code I write this :

My password is "test123", I encrypted its by spring security service and I get it from database.
I execute my SQL request by script shell from another grails  application and when I tried to connect with this user I can't.
But when I am trying to refresh my login/auth page two or three times I connect successfully, for the first I think that I am entering a wrong password or wrong username but when I verify I belive that my password and my username are correct.

I think that the problem is with session hibernate because after refreshing page it works. I can't get solution for this problem and I am blocked.


Best Regards,

Raja Charfi

Software Developer

[hidden email]
+216 24 75 53 03
<a href="skype:charfi.raja?call" style="text-decoration:none; font-size:10px; font-family:arial;color:#666; line-height:19px">charfi.raja
On 05/23/2014 03:42 PM, hblask [via Grails] wrote:
Can you read the password in the database?   If so, that may be your problem.  I think, by default, the plugin will use SHA-256 to encrypt the password.   So if you put a plain text password in the database, when you log in, you will be comparing a SHA-256 password vs plain text.


To unsubscribe from Problem to connect with Spring Security Core plugin with user created from DB, click here.
NAML

Loading...