Repository navigation
Description
I believe the default OIDC userinfo cache TTL (10 seconds) is too short, and I’d like to increase it.
According to the documentation, the PROXY_OIDC_USERINFO_CACHE_TTL environment variable is only applied when the access token does not have an expiration time. What is the reasoning behind this restriction? In our setup, the access token does have an expiration, which means we cannot increase the userinfo cache TTL at all.
We have two concrete reasons for wanting to increase the TTL:
1. Random user logouts
We are experiencing the same issue described in #1493, where users get logged out seemingly at random. One suggested workaround to mitigate this problem is increasing the OIDC userinfo cache TTL via PROXY_OIDC_USERINFO_CACHE_TTL, but this is not possible in our case due to the restriction mentioned above.
2. Excessive requests to the IdP userinfo endpoint
With a TTL of only 10 seconds, OpenCloud sends a large number of requests to the IdP’s userinfo endpoint. Our external IdP enforces rate limiting, and when many users are active at the same time, the userinfo endpoint starts returning 429 Too Many Requests, which negatively impacts user sessions.
Given these issues, it would be very helpful to understand the logic behind tying the userinfo cache TTL to the absence of an access token expiration, and whether this behavior could be reconsidered or made configurable.
Here is the configuration related to our external IdP:
---
services:
opencloud:
environment:
FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled" # noqa yaml[line-length]
PROXY_OIDC_REWRITE_WELLKNOWN: "true"
WEB_OIDC_CLIENT_ID: ${OC_OIDC_CLIENT_ID:-web}
PROXY_ROLE_ASSIGNMENT_DRIVER: "default"
OC_OIDC_ISSUER: ${IDP_ISSUER_URL}
# Start all services except idp. It is replaced by external service.
OC_EXCLUDE_RUN_SERVICES: idp
# IdP specific configuration for auto-provisioning
OC_LDAP_SERVER_WRITE_ENABLED: "true"
PROXY_AUTOPROVISION_ACCOUNTS: "true"
# Use the `sub` claim from the IdP for the user ID
# It must be a unique and stable identifier that doesn’t change over time.
# Most IdPs use the internal user ID as the `sub` claim
PROXY_USER_OIDC_CLAIM: "sub"
# Set the username from "preferred_username" claim
PROXY_AUTOPROVISION_CLAIM_USERNAME: "preferred_username"
# Our IdP does not use JWT for access token.
# https://github.com/opencloud-eu/opencloud/issues/1578#issuecomment-3346426680
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none"
# Our IdP may return usernames starting with digits, but OpenCloud
# does not by default accept usernames starting by a digit.
# Disable OpenCloud's default restrictions on allowed characters in usernames.
GRAPH_USERNAME_MATCH: "none"
# We need to set the IDP_DOMAIN to allow the CSP rules to be set correctly
IDP_DOMAIN: ${IDP_DOMAIN}
# The openCloud users need to be able to edit their account in the externa IdP
WEB_OPTION_ACCOUNT_EDIT_LINK_HREF: ${IDP_ACCOUNT_URL}
Activity
rhafer commentedon Feb 2, 2026
Could you please point me to the docs. I guess we need to make them a bit more precise about when
PROXY_OIDC_USERINFO_CACHE_TTLis actually used.If I understand you config correctly the access tokens issued by your IDP are not JWT tokens (at least you set:
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none"). In that case OpenCloud is not able to extract the token expiration from your access tokens (opencloud does currently no support token introspection) and it should fall back toPROXY_OIDC_USERINFO_CACHE_TTL.I guess the documentation is a bit missleading there. So to summarize:
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD=jwt) it will use that expiration time as the ttl for the userinfo cache.PROXY_OIDC_USERINFO_CACHE_TTLAs it's not really clear to me from the report: Have you already tried increasing
PROXY_OIDC_USERINFO_CACHE_TTLand found it didn't work? Or didn't you even try because the docs are somewhat unclear.mjnaderi commentedon Feb 2, 2026
Thanks for the detailed explanation. That clears things up.
Here is the documentation URL: https://docs.opencloud.eu/docs/dev/server/services/proxy/environment-variables/
Yes, your understanding is correct. In our setup, the access tokens issued by the IdP are not JWTs.
I had tried setting
PROXY_OIDC_USERINFO_CACHE_TTLin the past, but at that time it didn’t seem to have any effect. Based on your reply, I revisited this and tried again.It turns out the issue was on my side: previously, I was setting the value as a plain integer (e.g.
60for one minute). When I set it explicitly as a duration (e.g.5m), it worked as expected. WithPROXY_OIDC_USERINFO_CACHE_TTL=5m, OpenCloud does not send any requests to the userinfo endpoint during that period.So the behavior is now clear and working correctly for us. Thanks for the clarification and quick feedback.
docs(proxy): Clarify PROXY_OIDC_USERINFO_CACHE_TTL value
docs(proxy): Clarify PROXY_OIDC_USERINFO_CACHE_TTL value
docs(proxy): Clarify PROXY_OIDC_USERINFO_CACHE_TTL value