Les,

Thanks very much for your reply. My Jetty server is embedded in a java server application that we wrote. My earlier post from Friday is more detailed, but I scaled it back since I thought it might be scaring off potential help.

In another portion of my server application I set up some custom Realms in Shiro like so:


OurCustomRealm ourRealm = new OurCustomRealm(some, various, needed, services)

RealmSecurityManager securityManager = (RealmSecurityManager) SecurityUtils.getSecurityManager();
    List<Realm> newRealms = new ArrayList<Realm>();
    Collection<Realm> realms = securityManager.getRealms();
    if (realms != null) {
      newRealms.addAll(realms);
    }
    newRealms.add( ourRealm  );
    securityManager.setRealms(newRealms);



Then later on I start up the Jetty server like so:

         Server server = new Server(HTTP_SERVER_PORT);

          finalWebAppContextmyContext = newWebAppContext();
          myContext.setDescriptor(myContext + "/WEB-INF/web.xml");
myContext.setResourceBase(resourceDir + "/" + FileLocationsImpl.WEB_SERVER_FOLDER);
          myContext.setParentLoaderPriority(true);

          server.setHandler(myContext);
          server.start();



So how can I programmatically or via web.xml get my web app to use my OurCustomRealm authorizing realm which we are already using for regular server logins?

Thanks!
Chris



On 1/23/2012 11:22 AM, Les Hazlewood wrote:
Hi Chris,

In your INI config, I don't see any configured realms or that they are
configured on the SecurityManager.  For example:

[main]

realm1 = com.foo.shiro.realm.MyRealm
realm2 = com.foo.shiro.realm.AnotherRealm

securityManager.realms = $realm1, $realm2, ..., $realmN
# end .ini config

HTH,


Reply via email to