Results 1 to 3 of 3

Thread: security:x509 subject-principal-regex question

  1. #1
    Join Date
    Nov 2006
    Posts
    6

    Default 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. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    Try using (.*)
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3
    Join Date
    Nov 2006
    Posts
    6

    Default

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

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •