diff --git a/t/plugin/openid-connect.t b/t/plugin/openid-connect.t index 515319248c9ba..da9b0a400ca71 100644 --- a/t/plugin/openid-connect.t +++ b/t/plugin/openid-connect.t @@ -1303,3 +1303,44 @@ passed } --- response_body_like x-userinfo: ey.* + +=== TEST 34: Set up new route access the auth server via http proxy +--- ONLY +--- config + location /t { + content_by_lua_block { + local t = require("lib.test_admin").test + local code, body = t('/apisix/admin/routes/1', + ngx.HTTP_PUT, + [[{ + "plugins": { + "openid-connect": { + "client_id": "kbyuFDidLLm280LIwVFiazOqjO3ty8KH", + "client_secret": "60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa", + "discovery": "http://127.0.0.1:1980/.well-known/openid-configuration", + "redirect_uri": "https://iresty.com", + "ssl_verify": false, + "timeout": 10, + "scope": "apisix", + "proxy_opts": "http://username:password@127.0.0.1:8080", + "use_pkce": false + } + }, + "upstream": { + "nodes": { + "127.0.0.1:1980": 1 + }, + "type": "roundrobin" + }, + "uri": "/hello" + }]] + ) + + if code >= 300 then + ngx.status = code + end + ngx.say(body) + } + } +--- response_body +passed