You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/14 07:53:17 UTC

[GitHub] [apisix] zhuliquan opened a new issue, #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

zhuliquan opened a new issue, #8521:
URL: https://github.com/apache/apisix/issues/8521

   ### Current Behavior
   
   I want to convert Apisix authentication to upstream authentication by proxy rewrite-plugin, but I got error below:
   {"message":"Invalid user key in authorization"}
   I guess that proxy-rewrite changes authorization in headers before the basic-auth plugin in apisix.
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   I want to convert Apisix authentication to upstream authentication by proxy rewrite-plugin, but I got error below:
   {"message":"Invalid user key in authorization"}
   I guess that proxy-rewrite changes authorization in headers before the basic-auth plugin in apisix.
   
   ### Environment
   
   APISIX version is 2.1
   Consumer setting is:
   ```{
       "plugins": {
           "basic-auth": {
               "username": "zhuliquan",
               "password": "c8cabe9627b258016c373779fb896fa1"
           }
       },
       "username": "zhuliquan"
   }```json
   route setting is:
   ```
   {
       "plugins": {
           "prometheus": {
               "disable": false
           },
           "basic-auth": {
               "disable": false
           },
           "limit-count": {
               "time_window": 60,
               "disable": false,
               "count": 20,
               "redis_timeout": 1000,
               "rejected_code": 502,
               "key": "consumer_name",
               "policy": "local"
           },
           "consumer-restriction": {
               "whitelist": [
                   "zhuliquan"
               ],
               "rejected_code": 403,
               "disable": false,
               "type": "consumer_name"
           },
           "proxy-rewrite": {
               "scheme": "http",
               "disable": false,
               "uri": "/test_index/_search?size=0&from=0&preference=_primary_first",
               "headers": {
                   "set": {
                       "Authorization": "Basic ZXNfYWRtaW46cWlhbnhpbkBFUw=="
                   }
               }
           }
       },
       "name": "search_full_data",
       "priority": 0,
       "uris": [
           "/v1/files/_search_full_data"
       ],
       "methods": [
           "POST"
       ],
       "service_id": "00008"
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1354098394

   ```
   basic-auth                     # priority: 2520
   proxy-rewrite                  # priority: 1008
   ```
   
   `basic-auth` run before `proxy-rewrite`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1366408333

   > are your sure it work out on apisix 2.1?
   
   from: https://github.com/apache/apisix/blob/9c7e96e608099bcc7a0fa10b1ee4395e7a03d3fa/conf/config-default.yaml#L201-L224
   
   I think it should work on v2.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhuliquan commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
zhuliquan commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1365628373

   > > what can i do?
   > 
   > I mean proxy-rewrite shouldn't affect the results of basic-auth because it runs after the basic-auth plugin runs.
   
   are your sure it work out on apisix 2.1?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhuliquan commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
zhuliquan commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1364822044

   @tzssangglass waht can I do to exchange the execution order of two plugins


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhuliquan commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
zhuliquan commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1364830731

   > 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] moonming closed issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming closed issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin
URL: https://github.com/apache/apisix/issues/8521


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhuliquan closed issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
zhuliquan closed issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin
URL: https://github.com/apache/apisix/issues/8521


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] zhuliquan commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
zhuliquan commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1364831302

   > ```
   > basic-auth                     # priority: 2520
   > proxy-rewrite                  # priority: 1008
   > ```
   > 
   > `basic-auth` run before `proxy-rewrite`
   what can i do?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #8521: bug: proxy-write plugin reset authorization in headers will affect the use of basic auth plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8521:
URL: https://github.com/apache/apisix/issues/8521#issuecomment-1364948557

   > what can i do?
   
   I mean proxy-rewrite shouldn't affect the results of basic-auth because it runs after the basic-auth plugin runs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org