You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Manoj Khangaonkar <kh...@gmail.com> on 2009/06/25 03:15:06 UTC

Re: Using Active Directory realm with Quickstart

The QuickStart example sets the text file based realm with the line of code

SecurityManager.setRealm(new PropertiesRealm()) ;

Did you try

SecurityManager.setRealm(new ActiveDirectoryRealm()) ;

?

Manoj




On Wed, Jun 24, 2009 at 12:02 PM, Ancaeus <ms...@gmail.com> wrote:

>
> This newbie would like your help in using the Active Directory realm with
> the
> NON-web quickstart example.   How do I insert the Active Directory Realm
> object into the program?  How do I point the program towards my Active
> Directory server?
>
>  Ideally, in the end, I would like to detect that I am already logged in on
> my workstation (which relies on Active Directory), and use those
> credentials.  Alternatively I could, log in with username and password via
> Active Directory.
>
> I have been looking for some documentation on Shiro, without success.  All
> I
> have found is the Javadoc.  Is there any documentation explaining how it
> works (i.e., not in the form of a recipe)?
>
> Thanks very much.
>
> Matt Stillerman
> --
> View this message in context:
> http://n2.nabble.com/Using-Active-Directory-realm-with--Quickstart-tp3150734p3150734.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
>

Strange exception from JSec/Ki/Shiro in Grails + ZK application

Posted by John Cladmore <ju...@lorrev.org>.
Hi all,

I am sorry about the cross post.

The problem seems to be in Grails+ZK or JSec/Ki/Shiro.

I am getting the following exception when I call Subject.login():

Exception: java.lang.IllegalStateException: No SessionHandler or 
SessionManager


This is very strange, because I don't get this except if I use a .gsp 
login page or pass the username/password as a query string 
(http://host/app/stuff?u=username+p=password).  They both call the same 
AuthService.authenticate(...) method I have defined.

However, if I use a KZ .zul file with username and password input, the 
event handler in zk gets get the exception above.

If anyone have any idea, please help.

.v

PS.  I played around a bit last night by having the JSec/Ki session 
always created and that seemed to work for a few  tries but was never 
consistent.  Then I started getting that same exception for simply 
calling SecurityUtils.subject?.getSession().

Re: Using Active Directory realm with Quickstart

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

Manoj is correct - that is how you do it via code.

But if you're using the Servlet filter approach, you can just define the
following in the ShiroFilter's text config in the [main] section:

activeDirectoryRealm =
org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm
# because ActiveDirectoryRealm subclasses AbstractLdapRealm, you have access
to those properties too:
#activeDirectoryRealm.systemUsername = foo
#activeDirectoryRealm.systemPassword = bar
# etc.

Cheers,

Les

On Wed, Jun 24, 2009 at 9:15 PM, Manoj Khangaonkar <kh...@gmail.com>wrote:

> The QuickStart example sets the text file based realm with the line of code
>
> SecurityManager.setRealm(new PropertiesRealm()) ;
>
> Did you try
>
> SecurityManager.setRealm(new ActiveDirectoryRealm()) ;
>
> ?
>
> Manoj
>
>
>
>
> On Wed, Jun 24, 2009 at 12:02 PM, Ancaeus <ms...@gmail.com> wrote:
>
>>
>> This newbie would like your help in using the Active Directory realm with
>> the
>> NON-web quickstart example.   How do I insert the Active Directory Realm
>> object into the program?  How do I point the program towards my Active
>> Directory server?
>>
>>  Ideally, in the end, I would like to detect that I am already logged in
>> on
>> my workstation (which relies on Active Directory), and use those
>> credentials.  Alternatively I could, log in with username and password via
>> Active Directory.
>>
>> I have been looking for some documentation on Shiro, without success.  All
>> I
>> have found is the Javadoc.  Is there any documentation explaining how it
>> works (i.e., not in the form of a recipe)?
>>
>> Thanks very much.
>>
>> Matt Stillerman
>> --
>> View this message in context:
>> http://n2.nabble.com/Using-Active-Directory-realm-with--Quickstart-tp3150734p3150734.html
>> Sent from the Shiro User mailing list archive at Nabble.com.
>>
>>
>