You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Shay Matasaro <ma...@gmail.com> on 2009/02/27 14:50:57 UTC

login related methods

Hi All,

in the spring hibernate  example , class User exposes numerous methods 
related to the login process including isLockd() and setLockTimestamp(), 
etc...

i have reviewed the sample files and the API, but i could not find out 
how these methods are called, nor could i find any interface that has 
such methods , i did however find a LockedAccountException class, but i 
don't know , how it ties into the framework.

could someone please shed some light on the subject?

Thanks,
Shay

Re: login related methods

Posted by Shay Matasaro <ma...@gmail.com>.
Thanks Les,

i am already working on my custom realm , with a better understanding 
thanks to the comments on the previous  thread.

Shay


Les Hazlewood wrote:
> That would be used by the Realm implementation to ensure the user is 
> allowed to log in based on their account's state.
>
> For example:
>
> User user = //get user based on AuthenticationToken
> if ( user.isLocked() ) {
>     throw new LockedAccountException("Account is locked.  If you think 
> this is in error, please see an administrator");
> }
>
> //otherwise, return the AuthenticationInfo as required
>
> I don't know if the Spring/Hibernate sample app is making use of this 
> method or not - if it is not, it should be ;)
>
> Cheers,
>
> Les
>
> On Fri, Feb 27, 2009 at 8:50 AM, Shay Matasaro <matasaro@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi All,
>
>     in the spring hibernate  example , class User exposes numerous
>     methods related to the login process including isLockd() and
>     setLockTimestamp(), etc...
>
>     i have reviewed the sample files and the API, but i could not find
>     out how these methods are called, nor could i find any interface
>     that has such methods , i did however find a
>     LockedAccountException class, but i don't know , how it ties into
>     the framework.
>
>     could someone please shed some light on the subject?
>
>     Thanks,
>     Shay
>
>


Re: login related methods

Posted by Les Hazlewood <lh...@apache.org>.
That would be used by the Realm implementation to ensure the user is allowed
to log in based on their account's state.

For example:

User user = //get user based on AuthenticationToken
if ( user.isLocked() ) {
    throw new LockedAccountException("Account is locked.  If you think this
is in error, please see an administrator");
}

//otherwise, return the AuthenticationInfo as required

I don't know if the Spring/Hibernate sample app is making use of this method
or not - if it is not, it should be ;)

Cheers,

Les

On Fri, Feb 27, 2009 at 8:50 AM, Shay Matasaro <ma...@gmail.com> wrote:

> Hi All,
>
> in the spring hibernate  example , class User exposes numerous methods
> related to the login process including isLockd() and setLockTimestamp(),
> etc...
>
> i have reviewed the sample files and the API, but i could not find out how
> these methods are called, nor could i find any interface that has such
> methods , i did however find a LockedAccountException class, but i don't
> know , how it ties into the framework.
>
> could someone please shed some light on the subject?
>
> Thanks,
> Shay
>