I'm beginner of struts and I wont to use spring sec:
1) I won't to use MySQL for back end auth, I create two tables(authorities, users) but my configuration doesn't work.
What is spring configuration and tables in Mysql or how to have custom authentication-provider?
If I try this
<authentication-provider>
<password-encoder hash="md5"/>
<user-service>
<user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
</user-service>
</authentication-provider>
it works, but if I try this
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource" authorities-by-username-query="select username,authority from users where username=?"/>
</authentication-provider>
it doesn't work, what I'm doing wrong??
2) Is there any way to inject user as authenticated?
In my login page I get user as authenticated(using shibboleth SP which put user and his attributes in HTTP header) and spring controlling the rest of
pages, how to say spring that user is authenticated.
Regards, Tomaz
|