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-unsubscr...@apisix.apache.org.apache.org

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

Reply via email to