Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OIDC end_session_endpoint optional #20753

Merged

Conversation

oneonestar
Copy link
Member

Description

Make OIDC end_session_endpoint optional.
Fix #19844

Although this field is mandatory in the spec OpenID Connect RP-Initiated Logout 1.0 , the spec itself is not mandatory.
Some providers do not implement it:

https://openid.net/developers/how-connect-works/
image

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Feb 20, 2024
@oneonestar oneonestar marked this pull request as draft February 20, 2024 00:04
@oneonestar oneonestar marked this pull request as ready for review February 20, 2024 00:17
@oneonestar
Copy link
Member Author

oneonestar commented Feb 20, 2024

Looks like a bug to me.
It works with StaticConfigurationProvider (http-server.authentication.oauth2.oidc.discovery=false).

2024-02-20T09:24:53.681+0900	INFO	main	io.airlift.log.Logging	Logging to stderr
2024-02-20T09:24:53.682+0900	INFO	main	Bootstrap	Loading configuration
2024-02-20T09:24:53.723+0900	INFO	main	org.hibernate.validator.internal.util.Version	HV000001: Hibernate Validator 8.0.1.Final
2024-02-20T09:24:53.793+0900	INFO	main	Bootstrap	Initializing logging
2024-02-20T09:24:54.200+0900	ERROR	main	io.trino.server.Server	Configuration is invalid
==========

Errors:

1) Configuration property 'http-server.authentication.oauth2.end-session-url' was not used

==========

#20754

@mosabua
Copy link
Member

mosabua commented Feb 21, 2024

So should we update the docs .. I kinda feel like it would be better to merge this PR.

@oneonestar
Copy link
Member Author

oneonestar commented Feb 21, 2024

Currently, there are 3 ways to config a OAuth2 property:

  1. Static configuration (http-server.authentication.oauth2.oidc.discovery=false)
  2. Obtain from OpenID provider using OIDC discovery (http-server.authentication.oauth2.oidc.discovery=true)
  3. Obtain from OpenID provider using OIDC discovery, but overrides it in config file

Not all properties support all 3 ways.

This PR #20753 allows end_session_endpoint to be optional in the OIDC discovery.
This means we can turn on OIDC discovery feature even if OpenID provider doesn't support end_session_endpoint.
Without this PR, static configuration must be used if the provider doesn't support end_session_endpoint.

The issue (#20754) is about end_session_endpoint doesn't support the third
way but haven't been documented properly.

Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Mar 15, 2024
@mosabua
Copy link
Member

mosabua commented Mar 15, 2024

Does this look good now @Praveen2112 ?

@Praveen2112
Copy link
Member

I'll take a look

Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Apr 17, 2024
@mosabua mosabua added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Apr 30, 2024
@mosabua
Copy link
Member

mosabua commented Apr 30, 2024

Reminder @Praveen2112 and @oneonestar

@Praveen2112
Copy link
Member

@oneonestar Can we rebase it out.

Although this field is mandatory in the spec OpenID Connect RP-Initiated Logout 1.0 , the spec itself is not mandatory.

The spec mentions this mandatory and I'm not sure if we need to make it optional.

I would rely on @dain / @lukasz-walkiewicz opinion here.

@oneonestar oneonestar force-pushed the optional_end_session_endpoint branch from ca75cba to 5af1d8e Compare April 30, 2024 23:57
@whg517
Copy link

whg517 commented Jun 14, 2024

I'm trying to use dexidp on top of k8s to build automatically enhanced security authentication for projects using operator. When I was validating trino, I ran into the same problem. I would like to know how the current community views this issue, including how to deal with it in the future, and whether there is a roadmap?

@Praveen2112
Copy link
Member

Would like to have @lukasz-walkiewicz review here.

testStaticConfiguration(Optional.empty(), Optional.empty());
testStaticConfiguration(Optional.of("/access-token-issuer"), Optional.of("/userinfo"));
testStaticConfiguration(Optional.empty(), Optional.empty(), Optional.empty());
testStaticConfiguration(Optional.of("/access-token-issuer"), Optional.of("/userinfo"), Optional.empty());
Copy link
Member

Choose a reason for hiding this comment

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

Are these mixed cases any useful? Aren't two tests cases enough as previously?

Copy link
Member

Choose a reason for hiding this comment

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

Previously we weren't covering these cases right ? So aren't they good ?

Copy link
Member

Choose a reason for hiding this comment

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

@oneonestar Can we address this comment - Then I guess we could merge this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR makes endSessionPath optional.
This way ensures that the previous tests work with or without setting endSessionPath.

@Praveen2112 Praveen2112 merged commit 579c2e6 into trinodb:master Jul 10, 2024
95 checks passed
@Praveen2112
Copy link
Member

Thanks for fixing this issue

@github-actions github-actions bot added this to the 452 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed.
Development

Successfully merging this pull request may close these issues.

OIDC end_session_endpoint Property is Required
5 participants