You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harris Mark R <Ma...@doc.state.or.us> on 2013/03/19 22:43:33 UTC

Manager App not working with Windows authentication enabled

Environment:
IIS 7.5
Tomcat 7.037
AJP/1.3 connector (redirector.dll) v 1.2
Java 7

We have a requirement for a new intranet application that it use Windows authentication.  We have this working in our new application.  We do have IIS, the connector and Tomcat serving up the application with no problems.

What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible.  We have some staff that use the manager app routinely.
We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.   In the AJP property files we set the second one to only be mapped to the manager URL.  This did not work as we expected.

Anyone have any ideas on how to get the manager application working?

Excerpt from server.xml:
___________________________________________________
  <GlobalNamingResources>
    <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="E:\Tomcat\32Bit\7.0.37\conf\tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector connectionTimeout="12000" maxThreads="300" port="10000" protocol="AJP/1.3" tomcatAuthentication="false"/>
                <Connector connectionTimeout="12000" maxThreads="300" port="10005" protocol="AJP/1.3" tomcatAuthentication="true"/>
                <Connector connectionTimeout="20000" port="9080" protocol="HTTP/1.1" redirectPort="8443"/>
    <Engine defaultHost="localhost" jvmRoute="WA1" name="Catalina">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/>
      </Host>
    </Engine>
  </Service>


Excerpt from worker.properties file
______________________________________________
worker.list=WA1,MGR

worker.WA1.type=ajp13
worker.WA1.host=localhost
worker.WA1.port=10000
worker.WA1.connection_pool_size=300
worker.WA1.connection_pool_timeout=12

worker.MGR.type=ajp13
worker.MGR.host=localhost
worker.MGR.port=10005
worker.MGR.connection_pool_size=300
worker.MGR.connection_pool_timeout=12

Excerpt from uriworkermap.properties:
___________________________________________________
/manager|/*=MGR

R. Mark Harris


Re: Manager App not working with Windows authentication enabled

Posted by André Warnier <aw...@ice-sa.com>.
Harris Mark R wrote:
> Sorry, guess I was not clear enough.  We are using Microsoft's IIS to front-end Tomcat, not the Apache HTTP server.  Apache HTTP server is not an option for our environment.  We would prefer to use the Windows authenticated user passed to Tomcat by IIS, but are open to anything that works reliably.
> 
It's my turn to apologise.  That was clear in your original post, I just misread that.
It is the same however with IIS.  If the user is authenticated by IIS, and you set 
tomcatAuthentication="false", then Tomcat will take the user-id from what the IIS/AJP 
module is passing on from IIS, and it will not redo the user authentication by himself 
(him being Tomcat).


> As I said, our custom application is working great in this environment, but the manager app is not.  We are having trouble associating the roles that the manager app is expecting with the authenticated user.   We have tried altering the tomcat-users file just about every which way we could think of.   Essentially we need any way to associate the authenticated user with the " "manager-gui" that the manager app is expecting.  Would we need to implement a custom realm to make this work?
> 
Yes, I think that you understand the issue correctly.
Tomcat's standard "user access control" to an application is based on the concept of 
"roles". You tell Tomcat that any users who has a "role" xxx can access that application.
So Tomcat needs a way, given the present user-id, to find out if that user-id has this 
"role" (isUserInRole() ?).  Unfortunately, what AJP passes to Tomcat is only a user-id, 
not any kind of "roles" information that this user has.  I suppose that Tomcat somehow 
must use a <Realm> to get that kind of information, and I do not know if this Realm is 
capable of providing that information if it has not authenticated this user by itself.

Maybe there is a way to tell Tomcat, for the manager application, to just check the 
user-id, and not the role ? I suppose that the right place to check would be the 
applicable Servlet Specification, in the web.xml/<auth-constraints> paragraph.
How do you do it for your other application, the one that works ?


On a totally different track, if you want to use WIA anyway, you may want to have a look 
at Jespa, at http://www.ioplex.com.  It's a totally different authentication and security 
approach. based on a servlet filter in Tomcat which authenticates the Windows user 
directly at the Tomcat level, not on the base of the id that IIS determines (and AJP 
passes on).  Jespa is capable of "translating" the concept of Windows "users groups" into 
Tomcat "roles".  One advantage of that approach is that you would have the various Tomcat 
"roles" managed at the same place as the other user-management functions (on the Windows 
domain AD server), and not have a different set of user information for Tomcat alone.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager App not working with Windows authentication enabled

Posted by Harris Mark R <Ma...@doc.state.or.us>.
Sorry, guess I was not clear enough.  We are using Microsoft's IIS to front-end Tomcat, not the Apache HTTP server.  Apache HTTP server is not an option for our environment.  We would prefer to use the Windows authenticated user passed to Tomcat by IIS, but are open to anything that works reliably.

As I said, our custom application is working great in this environment, but the manager app is not.  We are having trouble associating the roles that the manager app is expecting with the authenticated user.   We have tried altering the tomcat-users file just about every which way we could think of.   Essentially we need any way to associate the authenticated user with the " "manager-gui" that the manager app is expecting.  Would we need to implement a custom realm to make this work?

- Mark Harris
- 

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: Tuesday, March 19, 2013 3:28 PM
To: Tomcat Users List
Subject: Re: Manager App not working with Windows authentication enabled

Harris Mark R wrote:
> Environment:
> IIS 7.5
> Tomcat 7.037
> AJP/1.3 connector (redirector.dll) v 1.2 Java 7
> 
> We have a requirement for a new intranet application that it use Windows authentication.  We have this working in our new application.  We do have IIS, the connector and Tomcat serving up the application with no problems.
> 
> What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible.  We have some staff that use the manager app routinely.
> We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.   In the AJP property files we set the second one to only be mapped to the manager URL.  This did not work as we expected.

Setting tomcatAuthentication="false" in this case means that Tomcat is going to rely on the authenticated user-id sent to it by the front-end, through AJP.
So you should authenticate the user at the Apache httpd front-end level.

> 
> Anyone have any ideas on how to get the manager application working?

How would you like the users of the manager application to be authenticated ?  also via Windows Integrated Authentication, or at the Apache httpd level, via some other mechanism ?

For a simple case, you could for example do this at the Apache httpd level :

<Location /manager>
   setHandler jakarta-servlet
   AuthType Basic
   AuthName tomcat-manager
   require user x y z ...
   ...
</Location>

(and set tomcatAuthentication="false")

("setHandler jakarta-servlet" in that <Location> section is roughly equivalent to "JkMount /manager" worker1)

This syntax is explained in one of the on-line AJP connector's info pages on the tomcat website, at the very end of the page.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager App not working with Windows authentication enabled

Posted by André Warnier <aw...@ice-sa.com>.
Harris Mark R wrote:
> Environment:
> IIS 7.5
> Tomcat 7.037
> AJP/1.3 connector (redirector.dll) v 1.2
> Java 7
> 
> We have a requirement for a new intranet application that it use Windows authentication.  We have this working in our new application.  We do have IIS, the connector and Tomcat serving up the application with no problems.
> 
> What did happen is that we discovered that the manager application that comes with Tomcat no longer is accessible.  We have some staff that use the manager app routinely.
> We did try to set up two AJP connectors, one defined in the server.xml with tomcatAuthentication="true" and another set to false.   In the AJP property files we set the second one to only be mapped to the manager URL.  This did not work as we expected.

Setting tomcatAuthentication="false" in this case means that Tomcat is going to rely on 
the authenticated user-id sent to it by the front-end, through AJP.
So you should authenticate the user at the Apache httpd front-end level.

> 
> Anyone have any ideas on how to get the manager application working?

How would you like the users of the manager application to be authenticated ?  also via 
Windows Integrated Authentication, or at the Apache httpd level, via some other mechanism ?

For a simple case, you could for example do this at the Apache httpd level :

<Location /manager>
   setHandler jakarta-servlet
   AuthType Basic
   AuthName tomcat-manager
   require user x y z ...
   ...
</Location>

(and set tomcatAuthentication="false")

("setHandler jakarta-servlet" in that <Location> section is roughly equivalent to "JkMount 
/manager" worker1)

This syntax is explained in one of the on-line AJP connector's info pages on the tomcat 
website, at the very end of the page.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org