You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ed Robbins <er...@concerto.com> on 2003/01/21 17:25:58 UTC

JDBC authentication

Ok, bear with me.  This is my first attempt at configuring Tomcat for
any type of authentication.  I've configured a host with a JDBCRealm to
use a Sybase database for authentication.  I added a security
constraint, login-config and  a security role, however when I point my
browser to the URL, I don't see that little password box I'm so anxious
to see.  The relavant config snippets are below, anyone who can put me
on the path to enlightenment would be deemed "a most knowledgeable and
esteemed person"  in my eyes :-)


Ed



<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
cookies="true" crossContext="true" debug="2"
docBase="/home/httpd/htdocs/erobbins/robbinsapps/IpnDownload"
mapperClass="org.apache.catalina.core.StandardContextMapper"
path="/IpnDownload" privileged="false" reloadable="true"
swallowOutput="false" useNaming="false"
wrapperClass="org.apache.catalina.core.StandardWrapper">

<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="xxxxxxx" connectionPassword="xxxxxxx"
connectionURL="jdbc:sybase:Tds:xxxxxxxxxxxxxxxxxx:1234" debug="2"
driverName="com.sybase.jdbc2.jdbc.SybDriver" roleNameCol="role_name"
userCredCol="user_pass" userNameCol="user_name"
userRoleTable="user_roles" userTable="user_names" validate="true"/>
          
          <security-constraint>
            <web-resource-collection>
              <web-resource-name>IpnDownload</web-resource-name>
              <description>Download location for Ipn web
apps</description>
              <url-pattern>/IpnDownload/*</url-pattern>
              <url-pattern>*</url-pattern>
            </web-resource-collection>
            <auth-constraint>
                <description>These are the roles who have
access</description>
                <role-name>download</role-name>
            </auth-constraint>
          </security-constraint>
          <login-config>
            <auth-method>BASIC</auth-method>
          </login-config>
          <security-role>
            <description>Download role</description>
            <role-name>download</role-name>
          </security-role>
        </Context>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBC authentication

Posted by Ed Robbins <ed...@erobbins.com>.
Oops I'm mixing my elements, kinda like mixing my metaphors, I meant
<url-pattern>.  

Sure enough, I just put the /IpnDownload/* and /* back in and it works
this time.  I must have fat fingered it earlier today.

Thanks.

Ed

On Tue, 2003-01-21 at 22:20, Craig R. McClanahan wrote:
> On 21 Jan 2003, Ed Robbins wrote:
> 
> > Date: 21 Jan 2003 21:49:00 -0500
> > From: Ed Robbins <ed...@erobbins.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: Tomcat Users List <to...@jakarta.apache.org>
> > Subject: Re: JDBC authentication
> >
> > This was exactly my problem, I moved the security constraint out of the
> > server.xml file and put it into the web.xml for the web app and it
> > magically started working:-)  The only problem I have now is that I
> > can't do a blanket url-mapping like
> >
> > <url-mapping>/*</url-mapping>
> >
> > or
> >
> > <url-mapping>/IpnDownload/*</url-mapping>
> >
> 
> What's a <url-mapping>?  The valid element in a web.xml file is
> <url-pattern>, and either of the above would be valid.  But "/*.jsp" would
> not be valid -- you have to use "*.jsp" instead.
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Ed Robbins <ed...@erobbins.com>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[OT] Opera vs. IE

Posted by Dan Payne <dp...@sotx.org>.
This is way OT but...

Speed test are showing (I've got a cable modem connection):

 Opera 6.04 downloads at a consistent ~1700 kilobits/second.
 IE 6.0.2800.1106 downloads at an inconsistent ~450 kilobits/second.

I was compelled to do the comparisons after noticing that file downloads on
Opera are consistently at much better speeds than IE. So here are the
questions:

1. Anyone else get the same results (test I used:
http://www.austin.rr.com/speedtest/speed.asp)
2. How do they do it? It's the same file, same connection. What's the
mechanism?

Any comments appreciated. Just really curious. And feel free to email me
off-list.

-Dan

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Tuesday, January 21, 2003 9:21 PM
To: Tomcat Users List
Subject: Re: JDBC authentication




On 21 Jan 2003, Ed Robbins wrote:

> Date: 21 Jan 2003 21:49:00 -0500
> From: Ed Robbins <ed...@erobbins.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: JDBC authentication
>
> This was exactly my problem, I moved the security constraint out of the
> server.xml file and put it into the web.xml for the web app and it
> magically started working:-)  The only problem I have now is that I
> can't do a blanket url-mapping like
>
> <url-mapping>/*</url-mapping>
>
> or
>
> <url-mapping>/IpnDownload/*</url-mapping>
>

What's a <url-mapping>?  The valid element in a web.xml file is
<url-pattern>, and either of the above would be valid.  But "/*.jsp" would
not be valid -- you have to use "*.jsp" instead.

Craig


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBC authentication

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 21 Jan 2003, Ed Robbins wrote:

> Date: 21 Jan 2003 21:49:00 -0500
> From: Ed Robbins <ed...@erobbins.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: JDBC authentication
>
> This was exactly my problem, I moved the security constraint out of the
> server.xml file and put it into the web.xml for the web app and it
> magically started working:-)  The only problem I have now is that I
> can't do a blanket url-mapping like
>
> <url-mapping>/*</url-mapping>
>
> or
>
> <url-mapping>/IpnDownload/*</url-mapping>
>

What's a <url-mapping>?  The valid element in a web.xml file is
<url-pattern>, and either of the above would be valid.  But "/*.jsp" would
not be valid -- you have to use "*.jsp" instead.

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBC authentication

Posted by Ed Robbins <ed...@erobbins.com>.
This was exactly my problem, I moved the security constraint out of the
server.xml file and put it into the web.xml for the web app and it
magically started working:-)  The only problem I have now is that I
can't do a blanket url-mapping like

<url-mapping>/*</url-mapping>

or 

<url-mapping>/IpnDownload/*</url-mapping>

These cause the XML parser to bomb and the web app fails to load, if I
specify <url-mapping>/*.jsp</url-mapping>, all is good with the world. 
However I want to protect everything so I was looking for a shortcut,
which I see references to on the net.

Thanks for the response.  You have been deemed "a most knowledgeable and
esteemed person", don't forget to add that to your resume! :-)

Ed

On Tue, 2003-01-21 at 20:00, mwm wrote:
> I had a look through your config stuff and it looked fairly similar to mine.
> (Which is the only one I've configured - though it's form-based.  Oh, and
> working.)
> I did have a <realm-name> entry, in login-config I think, but that didn't
> look like enough to cause a problem.
> 
> One thing has just occurred to me, though:  you seem to have everything in
> server.xml?  I've got the realm defined there but my security-constraint /
> login-config etc. are all in web.xml.  Might be worth a shot (in the absence
> of any other replies)....
> 
> Mike.
> 
> 
> ----- Original Message -----
> From: "Ed Robbins" <er...@concerto.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, January 21, 2003 4:25 PM
> Subject: JDBC authentication
> 
> 
> Ok, bear with me.  This is my first attempt at configuring Tomcat for
> any type of authentication.  I've configured a host with a JDBCRealm to
> use a Sybase database for authentication.  I added a security
> constraint, login-config and  a security role, however when I point my
> browser to the URL, I don't see that little password box I'm so anxious
> to see.  The relavant config snippets are below, anyone who can put me
> on the path to enlightenment would be deemed "a most knowledgeable and
> esteemed person"  in my eyes :-)
> 
> 
> Ed
> 
> 
> 
> <Context className="org.apache.catalina.core.StandardContext"
> cachingAllowed="true"
> charsetMapperClass="org.apache.catalina.util.CharsetMapper"
> cookies="true" crossContext="true" debug="2"
> docBase="/home/httpd/htdocs/erobbins/robbinsapps/IpnDownload"
> mapperClass="org.apache.catalina.core.StandardContextMapper"
> path="/IpnDownload" privileged="false" reloadable="true"
> swallowOutput="false" useNaming="false"
> wrapperClass="org.apache.catalina.core.StandardWrapper">
> 
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> connectionName="xxxxxxx" connectionPassword="xxxxxxx"
> connectionURL="jdbc:sybase:Tds:xxxxxxxxxxxxxxxxxx:1234" debug="2"
> driverName="com.sybase.jdbc2.jdbc.SybDriver" roleNameCol="role_name"
> userCredCol="user_pass" userNameCol="user_name"
> userRoleTable="user_roles" userTable="user_names" validate="true"/>
> 
>           <security-constraint>
>             <web-resource-collection>
>               <web-resource-name>IpnDownload</web-resource-name>
>               <description>Download location for Ipn web
> apps</description>
>               <url-pattern>/IpnDownload/*</url-pattern>
>               <url-pattern>*</url-pattern>
>             </web-resource-collection>
>             <auth-constraint>
>                 <description>These are the roles who have
> access</description>
>                 <role-name>download</role-name>
>             </auth-constraint>
>           </security-constraint>
>           <login-config>
>             <auth-method>BASIC</auth-method>
>           </login-config>
>           <security-role>
>             <description>Download role</description>
>             <role-name>download</role-name>
>           </security-role>
>         </Context>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Ed Robbins <ed...@erobbins.com>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBC authentication

Posted by mwm <to...@ward-murphy.co.uk>.
I had a look through your config stuff and it looked fairly similar to mine.
(Which is the only one I've configured - though it's form-based.  Oh, and
working.)
I did have a <realm-name> entry, in login-config I think, but that didn't
look like enough to cause a problem.

One thing has just occurred to me, though:  you seem to have everything in
server.xml?  I've got the realm defined there but my security-constraint /
login-config etc. are all in web.xml.  Might be worth a shot (in the absence
of any other replies)....

Mike.


----- Original Message -----
From: "Ed Robbins" <er...@concerto.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, January 21, 2003 4:25 PM
Subject: JDBC authentication


Ok, bear with me.  This is my first attempt at configuring Tomcat for
any type of authentication.  I've configured a host with a JDBCRealm to
use a Sybase database for authentication.  I added a security
constraint, login-config and  a security role, however when I point my
browser to the URL, I don't see that little password box I'm so anxious
to see.  The relavant config snippets are below, anyone who can put me
on the path to enlightenment would be deemed "a most knowledgeable and
esteemed person"  in my eyes :-)


Ed



<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
cookies="true" crossContext="true" debug="2"
docBase="/home/httpd/htdocs/erobbins/robbinsapps/IpnDownload"
mapperClass="org.apache.catalina.core.StandardContextMapper"
path="/IpnDownload" privileged="false" reloadable="true"
swallowOutput="false" useNaming="false"
wrapperClass="org.apache.catalina.core.StandardWrapper">

<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="xxxxxxx" connectionPassword="xxxxxxx"
connectionURL="jdbc:sybase:Tds:xxxxxxxxxxxxxxxxxx:1234" debug="2"
driverName="com.sybase.jdbc2.jdbc.SybDriver" roleNameCol="role_name"
userCredCol="user_pass" userNameCol="user_name"
userRoleTable="user_roles" userTable="user_names" validate="true"/>

          <security-constraint>
            <web-resource-collection>
              <web-resource-name>IpnDownload</web-resource-name>
              <description>Download location for Ipn web
apps</description>
              <url-pattern>/IpnDownload/*</url-pattern>
              <url-pattern>*</url-pattern>
            </web-resource-collection>
            <auth-constraint>
                <description>These are the roles who have
access</description>
                <role-name>download</role-name>
            </auth-constraint>
          </security-constraint>
          <login-config>
            <auth-method>BASIC</auth-method>
          </login-config>
          <security-role>
            <description>Download role</description>
            <role-name>download</role-name>
          </security-role>
        </Context>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>