{"action":"created","issue":{"url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/91","repository_url":"https://api.github.com/repos/pingidentity/lua-resty-openidc","labels_url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/91/comments","events_url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/91/events","html_url":"https://github.com/pingidentity/lua-resty-openidc/issues/91","id":258061646,"number":91,"title":"Question about session caching","user":{"login":"waldo2188","id":841872,"avatar_url":"https://avatars2.githubusercontent.com/u/841872?v=4","gravatar_id":"","url":"https://api.github.com/users/waldo2188","html_url":"https://github.com/waldo2188","followers_url":"https://api.github.com/users/waldo2188/followers","following_url":"https://api.github.com/users/waldo2188/following{/other_user}","gists_url":"https://api.github.com/users/waldo2188/gists{/gist_id}","starred_url":"https://api.github.com/users/waldo2188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldo2188/subscriptions","organizations_url":"https://api.github.com/users/waldo2188/orgs","repos_url":"https://api.github.com/users/waldo2188/repos","events_url":"https://api.github.com/users/waldo2188/events{/privacy}","received_events_url":"https://api.github.com/users/waldo2188/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-15T14:34:20Z","updated_at":"2017-09-15T14:52:00Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\nI use this library in front of web app that have no authentication system (Kibana, Traefik, ...).\r\nThe authentication is handled by an OpenId Provider that I host.\r\n\r\nWhen I checked the logs of the OpenId Provider, I found that each time Traefik made a server request, the `lua-resty-openidc` library made a request on the OpenId Provider. \r\n\r\nIs this behavior normal or did I miss some session caching configuration?\r\n\r\nHere is the setup of one of my web app :\r\n```lua\r\n    location ~* ^/kibana/ {\r\n    #location /kibana/ {\r\n\r\n        access_by_lua '\r\n                local cjson = require \"cjson\"\r\n\r\n                function inTable(tbl, item)\r\n                    for key, value in pairs(tbl) do\r\n                        if value == item then return key end\r\n                    end\r\n                    return false\r\n                end\r\n\r\n               local opts = {\r\n                    redirect_uri_path = \"/kibana/redirect_uri\",\r\n                    discovery = os.getenv(\"DISCOVERY_URL\"),\r\n                    client_id = os.getenv(\"CLIENT_ID\"),\r\n                    client_secret = os.getenv(\"CLIENT_SECRET\"),\r\n                    scope = os.getenv(\"SCOPE\"),\r\n                    ssl_verify = os.getenv(\"SSL_VERIFY\"),\r\n                    access_token_expires_in = 3600,\r\n                    access_token_expires_leeway = 30,\r\n                    force_reauthorize = false\r\n                }\r\n\r\n                local res, err = require(\"resty.openidc\").authenticate(opts, nil, nil, { secret = \"xxxxxx\" })\r\n\r\n                if err then\r\n                    ngx.status = 500\r\n                    ngx.say(err)\r\n                    ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)\r\n                end\r\n\r\n                if inTable(res.user.role, \"Kibana_access\") == false then\r\n                  ngx.exit(ngx.HTTP_FORBIDDEN)\r\n                end\r\n            ';\r\n```\r\n\r\nThanks for your help."},"comment":{"url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/comments/329805374","html_url":"https://github.com/pingidentity/lua-resty-openidc/issues/91#issuecomment-329805374","issue_url":"https://api.github.com/repos/pingidentity/lua-resty-openidc/issues/91","id":329805374,"user":{"login":"waldo2188","id":841872,"avatar_url":"https://avatars2.githubusercontent.com/u/841872?v=4","gravatar_id":"","url":"https://api.github.com/users/waldo2188","html_url":"https://github.com/waldo2188","followers_url":"https://api.github.com/users/waldo2188/followers","following_url":"https://api.github.com/users/waldo2188/following{/other_user}","gists_url":"https://api.github.com/users/waldo2188/gists{/gist_id}","starred_url":"https://api.github.com/users/waldo2188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldo2188/subscriptions","organizations_url":"https://api.github.com/users/waldo2188/orgs","repos_url":"https://api.github.com/users/waldo2188/repos","events_url":"https://api.github.com/users/waldo2188/events{/privacy}","received_events_url":"https://api.github.com/users/waldo2188/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T14:52:00Z","updated_at":"2017-09-15T14:52:00Z","author_association":"NONE","body":"Do you mean this parameter ?\r\n\r\n````json\r\n{\r\n    \"ClientId\": \"traefik\",\r\n    \"ClientName\": \"Traefik\",\r\n    \"GrantType\": \"authorization_code\",\r\n    \"AuthorizationCode\": \"xx\",\r\n    \"Raw\": {\r\n        \"redirect_uri\": \"https://xxx/traefik/redirect_uri\",\r\n        \"grant_type\": \"authorization_code\",\r\n        \"state\": \"xx\",\r\n        \"code\": \"xx\"\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"waldo2188"}}