Hi all,
I followed http://shiro.apache.org/spring.html to integrate Shiro into
Apache Cocoon3.
Basically the filterChainDefinitions are working fine since I get redirected
to the login page when I try to request a secure page.
However I am having problem with the realm it seems. I have
<bean id="myRealm"
class="org.apache.shiro.realm.text.TextConfigurationRealm">
<property name="userDefinitions">
<value>
thor = test, admin
x = x, user
</value>
</property>
<property name="roleDefinitions">
<value>
admin = *
user = user:*
</value>
</property>
</bean>
Then in my c3 login REST service I do
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
Subject subject = SecurityUtils.getSubject();
subject.login(token);
However the login never works I always get
2011-10-26 13:23:12,880 btpool0-1 ERROR servlet.XMLSitemapServlet - Cocoon
can't process the request.
org.apache.cocoon.sitemap.InvocationException:
org.apache.shiro.authc.UnknownAccountException: Realm
[org.apache.shiro.realm.text.TextConfigurationRealm@79414306] was unable to
find account data for the submitted AuthenticationToken
[org.apache.shiro.authc.UsernamePasswordToken - thor, rememberMe=false].
If I debug the service I find that
org.apache.shiro.realm.text.TextConfigurationRealm has in rolesDefinition
"\n admin = *\n user = user:*\n "
and userDefinition
"\n thor = test, admin\n x = x, user\n "
BUT both users and roles maps are empty.
I just started to use Shiro and would be very grateful if somebody can give
me a hint what I am doing wrong.
TIA for any feedback
--
Thorsten Scherler <thorsten.at.apache.org>
codeBusters S.L. - web based systems
<consulting, training and solutions>
http://www.codebusters.es/
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/Spring-TextConfigurationRealm-problems-tp6932391p6932391.html
Sent from the Shiro User mailing list archive at Nabble.com.