Skip to content

oauth2: make ID token cookie expiration configurable#44949

Open
jmsadair wants to merge 4 commits into
envoyproxy:mainfrom
jmsadair:configurable-oauth-expiration
Open

oauth2: make ID token cookie expiration configurable#44949
jmsadair wants to merge 4 commits into
envoyproxy:mainfrom
jmsadair:configurable-oauth-expiration

Conversation

@jmsadair
Copy link
Copy Markdown
Contributor

@jmsadair jmsadair commented May 8, 2026

Commit Message: oauth2: make ID token cookie expiration configurable
Additional Description: Adds a use_access_token_expiry_for_id_token_cookie to OAuth2Config. When true, the expiration time for the ID token cookie will always be derived from the access token responseexpires_in value rather than from the exp claim in the ID token JWT. This is useful when the access token response advertises a longer lifetime than the ID token and you want the ID token cookie to remain valid for the full duration.
Risk Level: low
Testing: unit test
Docs Changes: inline protobuf documentation added for new field
Release Notes: added
Platform Specific Features: N/A

Signed-off-by: James Adair <jadair@netflix.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #44949 was opened by jmsadair.

see: more, trace.

Signed-off-by: James Adair <jadair@netflix.com>
@jmsadair jmsadair marked this pull request as ready for review May 8, 2026 16:09
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #44949 was ready_for_review by jmsadair.

see: more, trace.

@mathetake
Copy link
Copy Markdown
Member

@wbpcode we are internally exercising this code path and logic for a very long time - can you take a look?

James Adair added 2 commits May 9, 2026 19:04
Signed-off-by: James Adair <jadair@netflix.com>
Signed-off-by: James Adair <jadair@netflix.com>
@kyessenov
Copy link
Copy Markdown
Contributor

/wait

@mathetake
Copy link
Copy Markdown
Member

ping @wbpcode

@mathetake mathetake removed the waiting label May 13, 2026
Comment on lines +307 to +313

// If set to true, the expiration time for the ID token cookie will always be derived from the
// ``expires_in`` field of the access token response rather than from the ``exp`` claim in the
// ID token JWT. This is useful when the access token response advertises a longer lifetime than
// the ID token and you want the ID token cookie to remain valid for that full duration.
// Default is false (use the ID token's own ``exp`` claim when available).
bool use_access_token_expiry_for_id_token_cookie = 28;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inclined this is an unexpected hack because we should respect the exp in the JWT. That's why JWT has exp.

cc @zhaohuabing as oauth2 expert.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented May 14, 2026

/wait-any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants