Authorization based on custom Header (Apache) Unicorn Meta Zoo #1: Why another podcast? ...

What to do with someone that cheated their way through university and a PhD program?

Could moose/elk survive in the Amazon forest?

What is the term for a person whose job is to place products on shelves in stores?

Can you stand up from being prone using Skirmisher outside of your turn?

Is there any hidden 'W' sound after 'comment' in : Comment est-elle?

What is /etc/mtab in Linux?

Is a 5 watt UHF/VHF handheld considered QRP?

c++ diamond problem - How to call base method only once

Suing a Police Officer Instead of the Police Department

What *exactly* is electrical current, voltage, and resistance?

Mistake in years of experience in resume?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Can I criticise the more senior developers around me for not writing clean code?

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

How would this chord from "Rocket Man" be analyzed?

Multiple options vs single option UI

What is the best way to deal with NPC-NPC combat?

Justification for leaving new position after a short time

Additive group of local rings

Seek and ye shall find

Is Diceware more secure than a long passphrase?

What’s with the clanks in Endgame?

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?



Authorization based on custom Header (Apache)



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!What is the difference between authentication and authorization?Apache 2.4 RequestHeader while reverse proxying with ProxyPassUse of ProxyPassReverse to change Location response headerBasic auth Apache with TomcatApache mod_proxy: redirection based on http header?Apache 2.4.7 mod_proxy_wstunnel tunneling too much (HTTP as well as WS)Migrate Apache Authorization Header rule to LighttpdApache set custom header with an evironment variableApache Custom Header with an environment variableApache mod_rewrite encode query string parameters





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a service running behind a Apache Reverse-Proxy that uses the custom headers "username" and "role" to identify users and their role.



I want Apache HTTPD to restrict access to to people whose custom HTTP-header "groupmembership" contains one of the following: "viewer","publisher","administrator".





The Apache sits behind another proxy which authenticates users and populates the HTTP Headers "username" and "groupmembership" where the contents of "groupmembership" is a comma-separated list with groups.



For reference I have included a draft of the architecture.
http-proxy-auth



How would this be possible? I have tried using a require directive like Require expr %{HTTP:iv_groupmembership} in { 'viewer', 'publisher', 'administrator' } inside <Location /> to no avail.



Could this instead work with mod_rewrite?



Here is the reverse-proxy config using mod_proxy and mod_rewrite:



RewriteEngine on
<Proxy *>
Allow from all
</Proxy>
ProxyRequests Off

# store variable values with dummy rewrite rules
RewriteRule . - [E=req_scheme:%{REQUEST_SCHEME}]
RewriteRule . - [E=http_host:%{HTTP_HOST}]
RewriteRule . - [E=req_uri:%{REQUEST_URI}]

# set header with variables
RequestHeader set X-RSC-Request "%{req_scheme}e://%{http_host}e%{req_uri}e"

RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:3939/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://localhost:3939/$1 [P,L]
ProxyPass / http://172.17.0.1:3939/
ProxyPassReverse / http://172.17.0.1:3939/


Thanks for any hints.









share







New contributor




juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I have a service running behind a Apache Reverse-Proxy that uses the custom headers "username" and "role" to identify users and their role.



    I want Apache HTTPD to restrict access to to people whose custom HTTP-header "groupmembership" contains one of the following: "viewer","publisher","administrator".





    The Apache sits behind another proxy which authenticates users and populates the HTTP Headers "username" and "groupmembership" where the contents of "groupmembership" is a comma-separated list with groups.



    For reference I have included a draft of the architecture.
    http-proxy-auth



    How would this be possible? I have tried using a require directive like Require expr %{HTTP:iv_groupmembership} in { 'viewer', 'publisher', 'administrator' } inside <Location /> to no avail.



    Could this instead work with mod_rewrite?



    Here is the reverse-proxy config using mod_proxy and mod_rewrite:



    RewriteEngine on
    <Proxy *>
    Allow from all
    </Proxy>
    ProxyRequests Off

    # store variable values with dummy rewrite rules
    RewriteRule . - [E=req_scheme:%{REQUEST_SCHEME}]
    RewriteRule . - [E=http_host:%{HTTP_HOST}]
    RewriteRule . - [E=req_uri:%{REQUEST_URI}]

    # set header with variables
    RequestHeader set X-RSC-Request "%{req_scheme}e://%{http_host}e%{req_uri}e"

    RewriteCond %{HTTP:Upgrade} =websocket
    RewriteRule /(.*) ws://localhost:3939/$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket
    RewriteRule /(.*) http://localhost:3939/$1 [P,L]
    ProxyPass / http://172.17.0.1:3939/
    ProxyPassReverse / http://172.17.0.1:3939/


    Thanks for any hints.









    share







    New contributor




    juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a service running behind a Apache Reverse-Proxy that uses the custom headers "username" and "role" to identify users and their role.



      I want Apache HTTPD to restrict access to to people whose custom HTTP-header "groupmembership" contains one of the following: "viewer","publisher","administrator".





      The Apache sits behind another proxy which authenticates users and populates the HTTP Headers "username" and "groupmembership" where the contents of "groupmembership" is a comma-separated list with groups.



      For reference I have included a draft of the architecture.
      http-proxy-auth



      How would this be possible? I have tried using a require directive like Require expr %{HTTP:iv_groupmembership} in { 'viewer', 'publisher', 'administrator' } inside <Location /> to no avail.



      Could this instead work with mod_rewrite?



      Here is the reverse-proxy config using mod_proxy and mod_rewrite:



      RewriteEngine on
      <Proxy *>
      Allow from all
      </Proxy>
      ProxyRequests Off

      # store variable values with dummy rewrite rules
      RewriteRule . - [E=req_scheme:%{REQUEST_SCHEME}]
      RewriteRule . - [E=http_host:%{HTTP_HOST}]
      RewriteRule . - [E=req_uri:%{REQUEST_URI}]

      # set header with variables
      RequestHeader set X-RSC-Request "%{req_scheme}e://%{http_host}e%{req_uri}e"

      RewriteCond %{HTTP:Upgrade} =websocket
      RewriteRule /(.*) ws://localhost:3939/$1 [P,L]
      RewriteCond %{HTTP:Upgrade} !=websocket
      RewriteRule /(.*) http://localhost:3939/$1 [P,L]
      ProxyPass / http://172.17.0.1:3939/
      ProxyPassReverse / http://172.17.0.1:3939/


      Thanks for any hints.









      share







      New contributor




      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a service running behind a Apache Reverse-Proxy that uses the custom headers "username" and "role" to identify users and their role.



      I want Apache HTTPD to restrict access to to people whose custom HTTP-header "groupmembership" contains one of the following: "viewer","publisher","administrator".





      The Apache sits behind another proxy which authenticates users and populates the HTTP Headers "username" and "groupmembership" where the contents of "groupmembership" is a comma-separated list with groups.



      For reference I have included a draft of the architecture.
      http-proxy-auth



      How would this be possible? I have tried using a require directive like Require expr %{HTTP:iv_groupmembership} in { 'viewer', 'publisher', 'administrator' } inside <Location /> to no avail.



      Could this instead work with mod_rewrite?



      Here is the reverse-proxy config using mod_proxy and mod_rewrite:



      RewriteEngine on
      <Proxy *>
      Allow from all
      </Proxy>
      ProxyRequests Off

      # store variable values with dummy rewrite rules
      RewriteRule . - [E=req_scheme:%{REQUEST_SCHEME}]
      RewriteRule . - [E=http_host:%{HTTP_HOST}]
      RewriteRule . - [E=req_uri:%{REQUEST_URI}]

      # set header with variables
      RequestHeader set X-RSC-Request "%{req_scheme}e://%{http_host}e%{req_uri}e"

      RewriteCond %{HTTP:Upgrade} =websocket
      RewriteRule /(.*) ws://localhost:3939/$1 [P,L]
      RewriteCond %{HTTP:Upgrade} !=websocket
      RewriteRule /(.*) http://localhost:3939/$1 [P,L]
      ProxyPass / http://172.17.0.1:3939/
      ProxyPassReverse / http://172.17.0.1:3939/


      Thanks for any hints.







      apache-2.4 mod-rewrite mod-proxy http-headers authorization





      share







      New contributor




      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 5 mins ago









      juojuo

      1




      1




      New contributor




      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      juo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          juo is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964521%2fauthorization-based-on-custom-header-apache%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          juo is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          juo is a new contributor. Be nice, and check out our Code of Conduct.













          juo is a new contributor. Be nice, and check out our Code of Conduct.












          juo is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964521%2fauthorization-based-on-custom-header-apache%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...