Skip to content

Conversation

@Jeidnx
Copy link

@Jeidnx Jeidnx commented Feb 1, 2026

Rework the initialization code for oidc providers:

  • Refactor the code to be more maintainable
  • split github into its own init function since its a very special case
  • Remove default values for {authorization,introspection,token} urls, since there is no standard default that could be used. All providers i know of support the discovery standard, which should be preferred instead of configuring these manually.
  • Adds automatic construction of the callback url.
  • Fixes oAuth can't parse client's sso urls #276

@Jeidnx Jeidnx force-pushed the oidc_discovery_fix branch from 3c155a6 to fce2e5a Compare February 2, 2026 16:47
@Jeidnx
Copy link
Author

Jeidnx commented Feb 2, 2026

Sorry i may have been a bit harsh with the words. I was still in my Software Engineering mindset and honestly a little frustrated since it took me some time to get this software to compile properly. (I will probably open an issue or a PR for the problems i encountered)

I refactored a lot of the configuration code, in my opinion this should be way better to read and maintain.
Github seems to be a very special case, so it only made sense that it gets it own function. The other branded providers comply with the discovery spec.
The callback_url really shouldn't be configurable, i fixed that and indicated it in the docs.

If you have any questions about the code please don't hesitate to ask

@Jeidnx Jeidnx marked this pull request as ready for review February 2, 2026 16:48
@Jeidnx Jeidnx force-pushed the oidc_discovery_fix branch from fce2e5a to f0a3df6 Compare February 3, 2026 11:37
@Jeidnx Jeidnx changed the title fix: assemble oidc discovery url correctly Rework oidc provider construction Feb 3, 2026
@Jeidnx Jeidnx force-pushed the oidc_discovery_fix branch from f0a3df6 to 03e6637 Compare February 3, 2026 12:00
@Jeidnx
Copy link
Author

Jeidnx commented Feb 3, 2026

Not sure why the CI fails on unchanged code. Runs fine on main: https://github.com/matrix-construct/tuwunel/actions/runs/21559255457/job/62120577532

@x86pup
Copy link
Member

x86pup commented Feb 3, 2026

I think this is some new issue with the typos tool we use for detecting typos, not the first time something like this has happened. We will handle it ourselves don't worry. Thank you for the contribution.

@aazf
Copy link

aazf commented Feb 4, 2026

@Jeidnx If possible, pls add username claim from OAuth provider.
some of provider return the username, not the preferred_username.

jevolk and others added 3 commits February 6, 2026 07:12
Signed-off-by: Jason Volk <jason@zemos.net>
Fixes the issue where discovery urls where assembled incorrectly.
Also removes the default values for unbranded providers, since there is no sane default that can be provided.
@jevolk jevolk force-pushed the oidc_discovery_fix branch from f0a3e96 to a7731f6 Compare February 6, 2026 07:13
@jevolk
Copy link
Member

jevolk commented Feb 6, 2026

When testing GitHub I 404'ed after the initial redirect. At a glance it might be that the base_path is not being applied. I can have a look but I have to merge the other pending items to main branch first.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oAuth can't parse client's sso urls

4 participants