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 2021/02/07 02:56:03 UTC

[GitHub] [apisix] cwy57885142 removed a comment on issue #3516: request help:

cwy57885142 removed a comment on issue #3516:
URL: https://github.com/apache/apisix/issues/3516#issuecomment-774580729


   > > 参考测试用例执行,缺少 issuedFor,该值指的是什么?
   > > {"error":"invalid_request","error_description":"You must provide the issuedFor"}
   > 
   > It looks like your request is abnormal and you need to provide your configuration example.
   
   请求:
   curl http://admin.test.com/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/echo",
       "plugins": {
           "authz-keycloak": {
               "token_endpoint": "http://172.20.11.181:8090/auth/realms/University/protocol/openid-connect/token",
   			"policy_enforcement_mode": "PERMISSIVE",
               "audience": "test_client"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "172.20.11.32:18080": 1
           }
       }
   }'
   
   获取access_token:
   curl --location --request POST 'http://172.20.11.181:8090/auth/realms/University/protocol/openid-connect/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'username=test_user' --data-urlencode 'password=123456' --data-urlencode 'client_id=test_client' --data-urlencode 'grant_type=password'
   
   验证: curl http://admin.tydic.com/echo -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ6SUxOWUMzaFp0LTI5emc2VVY2RWV6WGMxZEZyamxSLVIxNHJ2cHdsUmhBIn0.eyJleHAiOjIwNDQ2NjYwMDMsImlhdCI6MTYxMjY2NjAwMywianRpIjoiN2MxZDBhOWUtMzIxZC00YTYyLTk2NWQtZTNiNjg3ZTYzYThlIiwiaXNzIjoiaHR0cDovLzE3Mi4yMC4xMS4xODE6ODA5MC9hdXRoL3JlYWxtcy9Vbml2ZXJzaXR5IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImM2NTcyMzZhLWMxZTctNDNhMS05MjJmLWI2NDViZjZiNzhmOSIsInR5cCI6IkJlYXJlciIsImF6cCI6InRlc3RfY2xpZW50Iiwic2Vzc2lvbl9zdGF0ZSI6ImUxMDI0NzY3LTE0NjUtNDNjYi1hMWZhLTZlNDAzMjU1NTAxNyIsImFjciI6IjEiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ0ZXN0X3JvbGUiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoidGVzdF91c2VyIn0.vNv-KEQttVqQxAdkGi2huITSHXkMIkXhbiCd_1XlGvDbPGL26K1hkefAExtlcrwoOnXIoW9KCySo8etT
 aTrZ9Mz3X5FiNX64bIrPAFy5CspWodgnWS-Ck2gkUhUbSi6xJ7sR6TaI815WNQVl-x_newP4l8rAWNT6sSwBMPVc0LtKEk7m5Zhkcdy-KBSr_S2HKqCwJgw4Ll-XKh53sjOVJ6vaC1B2oxZf9n-DddV05z2Cw1d_X_fKoCb7EY5hKboXIUSYlW_MPc5FL4bEW0u-KYPb87OzAgZaWknN9yAlZMLetdQw7rGZJA3R1XBWedoTH6B8gIYmmCcc0EKsf0S0eQ'
   
   结果:
   {"error":"invalid_request","error_description":"You must provide the issuedFor"}
   


----------------------------------------------------------------
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.

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