Skip to content

Open ID Connect authentication implementation#1230

Merged
demiankatz merged 49 commits intovufind-org:devfrom
xmorave2:OpenIdConnect
Feb 27, 2025
Merged

Open ID Connect authentication implementation#1230
demiankatz merged 49 commits intovufind-org:devfrom
xmorave2:OpenIdConnect

Conversation

@xmorave2
Copy link
Contributor

@xmorave2 xmorave2 commented Sep 18, 2018

This is not done, but I would like to have some review on this.
TODO:

  • Fix continues integration failures
  • Ensure the work with sessions is OK

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks for this. I've left a few (mostly nitpicky) comments based on a quick browse of the code. Is there a particular aspect of this you are looking to have reviewed more closely? I'm not familiar with the underlying protocol, so I'd have to do some research to give a more substantive review.

@demiankatz
Copy link
Member

@xmorave2, thanks for the progress; please let me know when you're ready for me to take another look, and if there's anything more specific I can offer advice on.

@demiankatz
Copy link
Member

@xmorave2, I see you've done some recent work on this. Is it still in progress, or is it ready for potential review and merging? If it's still not ready, it might be worth adding some TODO checkboxes to the top description so we can keep track of progress and know when it is ready (assuming there are clear tasks that can be reduced to a checklist).

# Conflicts:
#	module/VuFind/src/VuFind/Auth/Factory.php
#	module/VuFind/src/VuFind/Auth/PluginManager.php
@demiankatz
Copy link
Member

@xmorave2, some of my refactoring for VuFind 6.0 caused conflicts here, so I have resolved them and brought your factory configuration up to date. I'm not able to test this, though, so please double-check that I haven't broken anything, and let me know if you need help with any fixes.

Updates aside, what is the status of this project?

@demiankatz
Copy link
Member

@xmorave2, I noticed this had a minor conflict with master; I have resolved it. Let me know if you'd like me to do any further testing/review at this stage.

@demiankatz
Copy link
Member

@xmorave2, just checking on the status of this PR. It's going to need to be brought up to date with Laminas following the migration from Zend. Would you like me to help with that? Is this any closer to being mergeable? No rush, in any case -- just wanted to check where things stand.

@xmorave2
Copy link
Contributor Author

xmorave2 commented Mar 5, 2020

@demiankatz I updated this pull request to use Laminas. My collegue is going to test this feature in near future hopefully, so we possibly could make it done...

@demiankatz
Copy link
Member

Thanks, @xmorave2; I'll await further news!

@demiankatz demiankatz changed the base branch from master to dev August 3, 2020 14:46
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @xmorave2 -- see below for a couple of small suggestions. I'll do some hands-on testing once you've made these adjustments (assuming you agree with them).

@demiankatz
Copy link
Member

Thanks, @xmorave2, this is looking good to me from the code perspective. I haven't had time to do hands-on testing yet, though, as it seems non-trivial to set up auth0.com. Do you think it might be feasible to set up Facebook login using this mechanism? Since the actual Facebook auth module has been broken since at least 2017 (see VUFIND-1237), it would be good to remove it if we could replace it with this. (Honestly, it would be good to remove it either way, since I doubt anyone needs it -- just wondering if it might be worth my time to try to come up with a sample configuration here that could serve as a replacement for proof-of-concept purposes).

Copy link
Contributor

@EreMaijala EreMaijala left a comment

Choose a reason for hiding this comment

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

HTTP request results need error checking before trying json_decode. Otherwise we may try to pass a plain-text error to json_decode and crash without providing any meaningful error message.

@xmorave2
Copy link
Contributor Author

@demiankatz I took a quick look and this PR is not able to handle Facebook login without some changes, and you will need a proper configuration as .well-known endpoint of Facebook does not return all the needed information

@EreMaijala I tried to ensure there is valid response before trying to call json_decode. In case of not successful response, the AuthException is raised as there is not a way how to continue normally if we do net get needed data...

@Owen-Fitz
Copy link

I've tested the latest commits from this PR and can confirm that onelogin and Auth0 both work without any issues.

@xmorave2
Copy link
Contributor Author

@Owen-Fitz: Thank you for good news ;)

Copy link
Contributor

@EreMaijala EreMaijala left a comment

Choose a reason for hiding this comment

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

In troubleshooting it might be useful to log the message in addition to the status code, but I suppose those situations would be rare.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, everyone! This PR has been open for about seven years -- very happy to see it finally completed! :-)

@demiankatz demiankatz merged commit 78e9051 into vufind-org:dev Feb 27, 2025
6 checks passed
@demiankatz demiankatz changed the title Open ID Connect implementation Open ID Connect authentication implementation Feb 27, 2025
@xmorave2
Copy link
Contributor Author

Thanks all for your testing and reviewing and for your patience!

@EreMaijala
Copy link
Contributor

@xmorave2 I think we need to add some documentation regarding the configuration to the wiki. The settings are quite clear as is, but e.g. the redirect URL should be documented somewhere because it's needed for server-side configuration for servers that are not open to anyone.

@demiankatz
Copy link
Member

@xmorave2 I think we need to add some documentation regarding the configuration to the wiki. The settings are quite clear as is, but e.g. the redirect URL should be documented somewhere because it's needed for server-side configuration for servers that are not open to anyone.

Maybe a good URL for such a wiki page would be https://vufind.org/wiki/configuration:oidc. Feel free to create a page there if you like... and let me know if you need my help setting things up.

@demiankatz demiankatz modified the milestones: 11.0, 10.2 Mar 15, 2025
ckaz pushed a commit to finc/vufind that referenced this pull request Mar 20, 2025
EreMaijala pushed a commit to EreMaijala/vufind that referenced this pull request Mar 27, 2025
@demiankatz
Copy link
Member

I've created a wiki page at https://vufind.org/wiki/configuration:authentication:oidc but it needs more details filled in by somebody with greater knowledge than me. :-)

{
// Adding the auth_method setting makes it possible to handle logins when
// using an auth method that proxies others (e.g. ChoiceAuth)
$targetUri = $target . (str_contains($target, '?') ? '&' : '?') . 'auth_method=oidc';
Copy link
Contributor

@stweil stweil Sep 19, 2025

Choose a reason for hiding this comment

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

OpenIDConnect works for me after fixing auth_method here. Should I send a pull request with a trivial fix (see stweil@f0b18b1), or did I miss something?

Copy link
Member

Choose a reason for hiding this comment

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

Please do! If something is not working for you, and a code change makes it work, that seems worth a PR -- we can discuss the particulars once the PR is open, should further adjustment be needed. (I'm not an expert on this code -- @xmorave2 and @EreMaijala might know more -- but in any case, I see no reason not to get the ball rolling, as it were). Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

See PR #4646.

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.

5 participants