Announcement Announcement Module
Collapse
No announcement yet.
security:x509 subject-principal-regex question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • security:x509 subject-principal-regex question

    Hi,

    This may really be a regex question but thought I would try here first since I am using Spring Security and I may be missing something.

    I am trying to get the entire subjectDN: contents using the <security:http> element.
    For example if the subjectDN is CN=My Name, OU=Org1, OU=Org2, C=US and I use the regex "CN=(.?)," I get "My Name" as the username in the loadUserByUsername() method. What I want to get is "CN=My Name, OU=Org1, OU=Org2, C=US" but I cannot figure what regex to use. Has anyone done this before?

    Here is my ApplicationSecurityContext.xml snippet:
    Code:
    <sec:http entry-point-ref="authProcessingFilterEntryPoint">
       <sec:x509 subject-principal-regex="^CN$" user-service-ref="userAuthService" />
    I have tried regexs like: "^CN$" and "(.?)" to no avail. Only picking our one field seems to work ( "CN=(.?)," )

    Thanks,

    Chris

  • #2
    Try using (.*)

    Comment


    • #3
      Rob, Thanks for the help .. it turned out to be (.*) to match the entire line ... thanks again!

      Originally posted by Rob Winch View Post
      Try using (.*)

      Comment

      Working...
      X