0

Problem with the identification of security roles in spring

asked 2011-05-25 11:29:08 +0800

jaider2523 gravatar image jaider2523
132 1

I have a file for a project where I iomplementar spring security, but I've tried and does not work, here emplo I put a file in which you connect to database, I recognize the user and its assigned role but not access the pages, please who can review it and tell me where is the error .... because I lost a long time and I could not get it to work properly.

Ideally, the system validates the user with access permissions according to an assigned role, I have all DAO structure and function but the spring configuration is not working ... In console can see the recognition process when run the project.

Download project:

Database: http://www.mediafire.com/file/3xsgmdkq8oxnted/seguridad.sql or http://www.mediafire.com/?3xsgmdkq8oxnted
Project: http://www.mediafire.com/file/nd02ndi764v3z5g/Practica.war or http://www.mediafire.com/?nd02ndi764v3z5g

My email is [email protected]

delete flag offensive retag edit

7 Replies

Sort by » oldest newest

answered 2011-05-30 14:40:57 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Hi jaider2523,

you must debug the zksample2. I have looked in your code. It's not enough to to use the UserImpl. You need the PolicyManager which implements spring-security UserDetailsService.
There is the ONLY ONE NEEDED method.

@Override
public UserDetails loadUserByUsername(String userId) {

Have a look at the de.forsthaus.policy packages and set as many breakpoints as you can.

best
Stephan

PS: Sorry, no support for spring-security. That's not a 10 minutes copy and paste challenge.

link publish delete flag offensive edit

answered 2011-05-31 07:06:37 +0800

jaider2523 gravatar image jaider2523
132 1

Ok, but I did not understand your answer very well, I do implement this method in my project, but the problem is that I get redirected to the index page, if it recognizes the user, but does not enter the application.

Your check my code? ...... please check to help me ... I am very worried.

link publish delete flag offensive edit

answered 2011-05-31 07:23:13 +0800

jaider2523 gravatar image jaider2523
132 1

I have followed all your instructions above and I think that I have no errors in the structure of the project, but does not work, that is why I write.

link publish delete flag offensive edit

answered 2011-05-31 12:48:32 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2011-05-31 12:48:58 +0800

Your check my code? ....

You have included the sources in the practica.war .

Have a look at the TWO index.zul files and where they are settled in Zksample2. Have according a look in the springSecurityContext about the ~/pages/index.zul.

link publish delete flag offensive edit

answered 2011-05-31 17:18:50 +0800

jaider2523 gravatar image jaider2523
132 1

Ok, I will review the code, but I have a question, your blog zk, Java, "openTruuls ™ and the world. blog about the zk framework", there is a tutorial about the configuration of spring, you need to complete ? ...

On the other hand in your zkexamploe 2 use AOP, but my project is not used.

Thanks for your help, I have not been set, but thank you very much.

link publish delete flag offensive edit

answered 2011-06-01 02:45:49 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

1. Yeah, you are right. The part5 is missing.
I will have a look on it if i had the time for it. But this is not interesting for your problem it's about customizing/extending the login params.

2. There are many many sample codes in the net where you can see how to make the transaction (the commit/rollback stuff) manual by code. Search the hibernate forums about it.

best
Stephan

link publish delete flag offensive edit

answered 2011-06-01 15:07:42 +0800

jaider2523 gravatar image jaider2523
132 1

Ok Stephan, thanks..

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-05-25 11:29:08 +0800

Seen: 514 times

Last updated: Jun 01 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More