<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Adam Young wrote:
<blockquote cite="mid:4EA9FFE7.20405@redhat.com" type="cite">
  <meta http-equiv="content-type" content="text/html; ">
Ade,<br>
  <br>
Your ealier emali discussed the renegotiation challenge based on the
Profiles.  <br>
  <br>
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://pki.fedoraproject.org/wiki/REST#Profiles">http://pki.fedoraproject.org/wiki/REST#Profiles</a><br>
  <br>
For the case where a user points a browser (say and Ajax request)  at
/pki/profiles   lets say that we have two cases:  one where the user is
authenticated and one where they are not.  In both cases, they get back
a collection, but in the case of unauthenticated it will have
significantly fewer entries.  <br>
  <br>
In this case, we would want the Java  equivalent of mod_nss:  <br>
  <br>
NSS_VerifyCLient: Optional<br>
  <br>
I'm guessing this a tomcatjss setting.<br>
</blockquote>
 clientAuth="want"<br>
<br>
For tomcatjss in server.xml<br>
<br>
The thing is though, the way this behaves is the user is asked for the
cert every time. The server then lets it go if the user choses not to
send one, or uses it if they do.<br>
<blockquote cite="mid:4EA9FFE7.20405@redhat.com" type="cite"> <br>
In this case, if the user has the certificate, they can present it, but
if they don't,  the operation will complete.  I think this is what we
want.  We always ask for the certificate, but we say it is OK if you
don't have it, you just don't get the data.<br>
  <br>
In the case where the user is asking for an object, say an actual
profile, and they don't have sufficient privs,  they get back a hard
and fast error:  probably 403.2 <br>
  <br>
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://en.wikipedia.org/wiki/HTTP_403">http://en.wikipedia.org/wiki/HTTP_403</a><br>
  <br>
For something like CSRs, we probably want to restrict access to
agents.  In that case, if an unauthenticated user, or one without
appropriate privs,  attempts to access that URL,  they also get a 403.2.<br>
  <br>
I don't know how this works in with the renegotiate, but I am guessing
that every time the user without a certificate hits an "Optional" page
they will be asked for their cert.  This might be chatty.  No idea.<br>
  <br>
So in general,  we tag the URLS either <br>
NSS_VerifyClient: Require  if they must be authenticated to use them<br>
NSS_VerifyClient: Optional  if they see different results based on
authentication or not<br>
NSS_VerifyClient: None if they can view them unauthenticated and see
the same results as everyone else<br>
  <br>
  <br>
IN the pki/WEB-INF/web.xml,  this probably maps to something like this:<br>
  <pre><security-constraint> 
   <web-resource-collection>
     <web-resource-name>Protected Resource</web-resource-name>
     <url-pattern><b>/*/profile</b></url-pattern>
   </web-resource-collection>
  </pre>
  <pre>    <auth-constraint>
         <role-name><b>anonymous</b></role-name>
         <role-name><b>agent</b></role-name>
   </auth-constraint>
  </security-constraint></pre>
  <br>
I'm guessing that we want to specify a role for anonymous as opposed to
no role.  <br>
  <br>
  <pre><web-app>
...

<login-config>
 <auth-method>CLIENT-CERT</auth-method>
   <realm-name>Tomcat Manager Application</realm-name>
   <realm-name>PKICA</realm-name>
  </login-config>
...
</web-app></pre>
  <br>
  <br>
the PKICA  Realm would be defined at the server level, in
conf/server.xml.  Something like:<br>
  <br>
  <br>
  <img alt="" src="cid:part1.03010306.06090304@redhat.com" border="0"
 height="1" hspace="0" vspace="0" width="1">
  <pre><Realm   className="com.netscape.catalina.realm.LDAPCertRealm"
     connectionURL=<a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E" href="ldaps://localhost:8389">"ldaps://localhost:8389"</a>
       userPattern="uid={0},ou=people,dc=mycompany,dc=com"
          roleBase="ou=groups,dc=mycompany,dc=com"
          roleName="cn"
        roleSearch="(uniqueMember={0})"
/>
  </pre>
There is a class  that almost does what we want.<br>
  <br>
 <b>org.apache.catalina.realm.JNDIRealm</b>.  <br>
  <br>
I suspect we can subclass it.  It has two ways of doing the auth : 
Bind mode and Comparison mode.  It might be possible to add a  Client
Cert mode in a subclass.  docs are here:<br>
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JNDIRealm">http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JNDIRealm</a><br>
  <br>
  <br>
  <br>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Pki-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pki-devel@redhat.com">Pki-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/pki-devel">https://www.redhat.com/mailman/listinfo/pki-devel</a>
  </pre>
</blockquote>
<br>
</body>
</html>