LDAP auth depending on uri

hi,

Is there a way to start authentication (prompting HTTP auth window to user and forwarding credentials to LDAP backend) only when uri starts with /need_auth/ but not /public and /?

VS with attached auth profile tries authenticate all traffic but I can’t write iRule without profile anyway. So problem is bypassing authentication when uri does not match /need_auth.

you can make copy of rule _sys_auth_ldap in profile_base.conf. Change the corresponding section like bellow. And apply this rule to the auth profile.

when HTTP_REQUEST {
        if {[HTTP::uri] contains "need_auth"} {
          AUTH::username_credential $tmm_auth_ldap_sid [HTTP::username]
          AUTH::password_credential $tmm_auth_ldap_sid [HTTP::password]
          AUTH::authenticate $tmm_auth_ldap_sid
          HTTP::collect
        }
    }