You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by rtunge <d....@yahoo.com.au> on 2011/06/19 13:51:31 UTC

first new user

hello all..how is it possible 2 create  a user for the first time who  can
then creates other users?  if we used a application for this...how can shiro
be configured to recognize the password of the first user we have set up in
our database  or someother data source? sorry very new to this topic. thanks


--
View this message in context: http://shiro-user.582556.n2.nabble.com/first-new-user-tp6492743p6492743.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: first new user

Posted by Les Hazlewood <lh...@apache.org>.
Hi there,

You can create a user and assign them a particular role or permission
that implies they have the ability to create users.

Once you assign that role or permission to the user, and that user
logs in, they will be able to create other users.

You will need to use a realm implementation that uses your datasource
to lookup user roles and/or permissions and returns them back to Shiro
in the form of an AuthorizationInfo object.

You can look at Shiro's existing AuthorizingRealm class and see its
getAuthorizationInfo and doGetAuthorizationInfo JavaDoc.  If you're
using a relational database, you might want to see the JdbcRealm as
that may be good enough for your needs.  If not, creating a subclass
of AuthorizingRealm is pretty easy.

HTH,

-- 
Les Hazlewood
CTO, Katasoft | http://www.katasoft.com | 888.391.5282
twitter: http://twitter.com/lhazlewood
katasoft blog: http://www.katasoft.com/blogs/lhazlewood
personal blog: http://leshazlewood.com