lua-resty-openidc icon indicating copy to clipboard operation
lua-resty-openidc copied to clipboard

Site freezes after few minutes of inactiveness

Open nirb4321 opened this issue 2 years ago • 3 comments

Environment
  • Image version: openresty/openresty:1.19.9.1-2-alpine
  • OpenID Connect provider : ADFS
Expected behaviour

Site won't freeze

Actual behaviour

we are a ReactJS application with OIDC and we experience the following issue:

A user who hasn't been active for few hours and attempts to keep working gets errors until the site is hard refreshed.

By watching the Network tab in the developer tools we get CORS error with the our Authorization Server for some reason. Moreover, this behavior started after we moved to OIDC authentication (we used Kerberos before).

In addition, in our environment each user is a member of many security groups, that fact causes the ID token and the Access token to be very large, therefore our session cookie is extremely large. Are there any solutions to this problem? Thank you!

Minimized example

Minimal, complete configuration that reproduces the behavior. We use the same configuration as this one :

  • https://github.com/evry/docker-oidc-proxy But inside the session cookie we only use ID Token
Configuration and NGINX server log files

auth.lua.txt Config and logs for the minimized example, possibly provided as attachments.

nirb4321 avatar Apr 04 '22 13:04 nirb4321

cors added a photo of the issue

nirb4321 avatar Apr 04 '22 13:04 nirb4321

I have the same situation with CORS - "Access to internal resource at 'https://oidc-server.com....' (redirected from 'https://server') from origin 'https://server' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.". I tried to add this header on the level of NGINX but the LUA script doesn't inherit it.

dnabiev avatar May 06 '22 20:05 dnabiev

Solved it by adding the URL to allow CORS in our ADFS providers

nirb4321 avatar May 07 '22 16:05 nirb4321