You’d want to do something like this:

1) Define your own impl of the principal resolver that does the parsing of CN
2) Plug that in via re-defining the 
x509AuthenticationEventExecutionPlanConfigurer bean. Here’s the current bean 
definition for you to serve as an example: 
https://github.com/apereo/cas/blob/master/support/cas-server-support-x509/src/main/java/org/apereo/cas/adaptors/x509/config/X509AuthenticationConfiguration.java#L275

Please note the the above “customization strategy” is only available since 5.2 
(use SNAPSHOTS for that).

Cheers,
D.

From: Fabio Martelli <[email protected]>
Reply: [email protected] <[email protected]>
Date: July 17, 2017 at 6:52:36 AM
To: [email protected] <[email protected]>
Subject:  [cas-user] X509 principal resolver to extract substring from CN  

Hi All, I've just configure X509 authentication on my CAS 5.1.2  
installation.  

Unfortunately I still missing a good principal resolver permitting to  
extract part of CN from SubjectDN.  

I've the following configuration  

cas.authn.x509.principal.principalAttribute=CN  
cas.authn.x509.principal.returnNull=false  
cas.authn.x509.principalDescriptor=$CN  
cas.authn.x509.principalType=SUBJECT  

but I need something more to extract a particular substring from CN  

Can you address me towards a principal resolver permitting me to specify  
a regexp to be used to extract principal from CN?  

In case it doesn't exist, can you give me a tip to specify a custom one?  

My CN is something like as  
"CN=fabio.martelli/6110000028099004.eHbeoxQkaF63vgZG+cX5jPQF7". I need  
to extract fabio.martelli as principal name.  

Thank you in advance.  

BR,  

F.  

--  
Fabio Martelli  
https://it.linkedin.com/pub/fabio-martelli/1/974/a44  
http://blog.tirasa.net/author/fabio/index.html  

Tirasa - Open Source Excellence  
http://www.tirasa.net/index.html?pk_campaign=email&pk_kwd=fm  

Apache Syncope PMC  
http://people.apache.org/~fmartelli/  

--  
- CAS gitter chatroom: https://gitter.im/apereo/cas  
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html  
- CAS documentation website: https://apereo.github.io/cas  
- CAS project website: https://github.com/apereo/cas  
---  
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.  
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].  
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/9a6fb515-7d16-6cbe-e97a-15be2444fe3d%40gmail.com.
  

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/etPan.596cafb0.3ef588ce.2e1%40unicon.net.

Reply via email to