Apache Config - Exclude Location from Authentication

后端 未结 2 1120
孤城傲影
孤城傲影 2021-01-17 16:19

I have a web application that is being protected by a Shibboleth authentication module. My current config is as below


 AuthType shibb         


        
相关标签:
2条回答
  • 2021-01-17 17:18

    My comment towards the end regarding the exclusion of additional files being loaded by Login.html ended up being correct. I used the following format to exclude the files that were being loaded by the html file

    <Location ~ "/MyApp/(Login.html|SessionTimeout.html|accessDenied.html|/badRequest.html|status|css/*|login/*|images/*|style/*|js/*|javascript/*|)">   
      Satisfy Any   
      Allow from all   
      AuthType None   
      Require all granted   
    </Location>
    
    0 讨论(0)
  • 2021-01-17 17:25

    When using Apache 2.4 instead of 2.2, in order to exclude "/server-status", the following was enough:

    <LocationMatch "^(?!/server-status)">
        AuthType Basic
        AuthUserFile /etc/apache2/.htpasswd
        <RequireAll>
            Require ssl
            Require user valid_user_name
        </RequireAll>
    </LocationMatch>
    

    Analyzing:

    • <LocationMatch "regex"> is equivalent to <Location ~ "regex">.
    • The regex used, is pcre (perl compatible regular expressions).
    • ^(?!/server-status) means:
      • ^: "starts with"
      • (?!): "negative look ahead (instead of positive (?=))"
    0 讨论(0)
提交回复
热议问题