Bug 901309 (JBPAPP6-1772) - SubjectCNMapper is not called with CertificatesRoles login-module
Summary: SubjectCNMapper is not called with CertificatesRoles login-module
Keywords:
Status: CLOSED WONTFIX
Alias: JBPAPP6-1772
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Security, Web
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: EAP 6.4.0
Assignee: Stefan Guilhen
QA Contact: Josef Cacek
URL: http://jira.jboss.org/jira/browse/JBP...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-09 05:20 UTC by Hisanobu Okuda
Modified: 2018-12-06 14:55 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-19 09:10:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPAPP6-1772 0 Major Closed SubjectCNMapper is not called with CertificatesRoles login-module 2016-08-19 09:23:37 UTC
Red Hat Issue Tracker PRODMGT-431 0 Major Resolved Certificate to Username mapping not customisable anymore 2016-08-19 09:23:36 UTC
Red Hat Issue Tracker WFLY-1056 0 Major Open Certificate to principal mapping 2016-08-19 09:23:36 UTC
Red Hat Knowledge Base (Solution) 293793 0 None None None Never

Description Hisanobu Okuda 2013-01-09 05:20:05 UTC
Help Desk Ticket Reference: https://na7.salesforce.com/500A000000CR6th
project_key: JBPAPP6

I'm using the CertRolesLoginModule to perform CLIENT_CERT authentication with EAP 6.0.1. I configured my security-domain to use SubjectCNMapper to map a principal's name to CN as follow:-

{code}
  <security-domain name="mycertauth" cache-type="default">
    <authentication>
      <login-module code="CertificateRoles" flag="required">
        <module-option name="securityDomain" value="mycertauth"/>
        <module-option name="verifier" value="org.jboss.security.auth.certs.AnyCertVerifier"/>
        <module-option name="rolesProperties" value="${project.build.outputDirectory}/config/ws-roles.properties"/>
      </login-module>
    </authentication>
    <mapping>
      <mapping-module code="org.jboss.security.mapping.providers.principal.SubjectCNMapper" type="principal" />
    </mapping>                   
    <jsse truststore-url="${project.build.outputDirectory}/config/ServerTrustStore.jks"
                          truststore-password="password"
                          truststore-type="jks" client-auth="true"
                          keystore-url="${project.build.outputDirectory}/config/ServerKeyStore.jks"
                          keystore-password="password"
                          keystore-type="jks"
                            />
  </security-domain>
{code}

But it does not affect, and HttpServletRequest#getUserPrincipal()#getName() returns DN.

Comment 1 Hisanobu Okuda 2013-06-20 08:49:37 UTC
Hi Anil,
Can you put it in the block list of 6.1.x?

Comment 2 JBoss JIRA Server 2013-06-21 16:41:49 UTC
John Doyle <jdoyle> made a comment on jira PRODMGT-431

I just reviewed the GSS ticket.  Is it a correct understanding that the behavior the customer wants worked in 6.0 but does not in 6.1?  Seems like a regression to me if that's the case and not a Feature Request.

Comment 3 JBoss JIRA Server 2013-06-23 22:23:28 UTC
Hisanobu Okuda <hokuda> made a comment on jira PRODMGT-431

In EAP 6.0.0, request.getUserPrincipal().getName() returns CN. In EAP 6.0.1 and 6.1.0, it returns DN. The behavior is a regression to the customer of the GSS ticket, but other customer would think of it as an enhancement. The problem is that it is not configurable.

Comment 4 JBoss JIRA Server 2013-06-23 22:39:30 UTC
Hisanobu Okuda <hokuda> made a comment on jira PRODMGT-431

In EAP5, it is configurable. In that sense, it is a regression.

Comment 5 JBoss JIRA Server 2013-09-17 19:16:22 UTC
Derek Horton <dhorton> made a comment on jira PRODMGT-431

This did work in EAP 6.0.0.  However, I think the changes to fix the JAAS cache issue likely changed the behavior.  As a result, upgrading to 6.0.1 "broke" the customers code.

Like Hisanobu says, the real issue here is that it is not configurable in 6.x.  In 5.x, you could configure the mappers at the JBossWebRealm level.  This is not possible in EAP 6.

I think the best thing to do would be to make it so that the principal mappers get called at the web level.

We have provided the customer with an acceptable workaround.  It is described in this knowledge base article:
https://access.redhat.com/site/solutions/293793

For this particular customer, they needed to implement a custom principal and a custom SSL authenticator.

Comment 6 Stefan Guilhen 2013-10-25 19:42:54 UTC
A property to allow configuration of the certificate mapper should have been added to the web subsystem since its inception. Adding it now is not trivial (there is no place to configure the WebRealm in the web subsystem). We could look into adding a system property to allow for the config of the mapper or just use the workaround Derek described above.

I'm setting devel_ack to "-". There is a workaround available and I think we need more time to come up with a proper solution. If anybody thinks that adding a system property is a good idea we can probably code something next week.


Note You need to log in before you can comment on or make changes to this bug.