Skip to content

Commit

Permalink
Update oidc.lua to set timeout (kubernetes#103)
Browse files Browse the repository at this point in the history
* Update oidc.lua

* Update oidc.lua

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update oidc.lua

* Update oidc.lua

* Update oidc.lua

* Update oidc.lua
  • Loading branch information
rashmi43 authored and Qing Hao committed Sep 30, 2019
1 parent 941f911 commit 91425d9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions rootfs/opt/ibm/router/nginx/conf/oidc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,24 @@ local function validate_access_token_or_exit()

if not res then
ngx.log(ngx.NOTICE, "Failed to request userinfo=",err)
return exit_401()
ngx.log(ngx.NOTICE, "Retrying userinfo..retry attempt 2 ")
res, err = httpc:request_uri("https://platform-identity-provider.kube-system.svc."..cluster_domain..":4300/v1/auth/userInfo", {
method = "POST",
ssl_verify = false,
body = "access_token=" .. token,
keepalive_pool = 10,
headers = {
["Content-Type"] = "application/x-www-form-urlencoded",
}
})
end
ngx.log(ngx.NOTICE, "Response status =",res.status)

if not res then
ngx.log(ngx.NOTICE, "Failed to request userinfo=",err)
return exit_401()
end

ngx.log(ngx.NOTICE, "Response status =",res.status)
if (res.body == "" or res.body == nil or res.status >= 400)
then
ngx.log(ngx.NOTICE, "Empty response body=",err)
Expand Down

0 comments on commit 91425d9

Please sign in to comment.