Forum Discussion

rwagner1's avatar
rwagner1
Icon for Nimbostratus rankNimbostratus
Aug 22, 2017

How do you filter a SAML Attribute

We currently use the memberOf %{session.ad.last.attr.memberOf} attribute. Is there a way to filter its so we only send a single attribute for CN=ABC Users? We cannot specify this in the Access Policy because we have different IDP's and SP's using the same Policy.

 

2 Replies

  • Just a quick thought from top of my head - you can write an iRule to extract the data you need, and store it in the session:

    when ACCESS_ACL_ALLOWED {
    
      set ad_memberOf [ACCESS::session data get "session.ad.last.attr.memberOf"]
    
      ACCESS::session data set "session.custom.memberOfABC" [string match "*CN=ABC Users*" $ad_memberOf]
    }
    

    Then, you can return it in your SAML assertion via

    %{session.custom.memberOfABC}
    , which will contain either
    0
    or
    1
    , depending on whether the user is a member of
    CN=ABC Users