/return-path not found

Created on 24 May 2024, 6 months ago
Updated 1 July 2024, 5 months ago

Problem/Motivation

I have sso_connector installed in 2 sites, one is the IDP and the other is the SP.

I copied the generated token from the IDP to the SP site.

When I'm logged out of both sites, I go to the SP, and the login link takes me to the IDP and shows page not found at /return-url.

If I log into the IDP site and go back to the SP login, it redirects to the IDP site where I'm still logged in.

Another thing I noticed is that the SP path has to end with a trailing slash in order to match the referrer. Maybe that can be adjusted so it's less sensitive.

Thanks for your work on this. It's still relatively painless compared to other SSO setups. I'm excited for the potential.

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mortona2k
  • First commit to issue fork.
  • Assigned to cesarmsfelipe
  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    Hi @mortona2k, I have made some changes that fix the problem, adding routing and fixing some user sync issues. Could you try with the beta1 tag and check if you can now use the module correctly?

  • Status changed to RTBC 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I just got it working. It looks like the user sync isn't working.

    I got these errors on my SP site when the users only on the IDP site:

    11632 26/May 16:44 sso_connector Critical Failed to synchronize or log in the user with email goodbye@example.com, redirecting to error.
    11631 26/May 16:44 sso_connector Error User not found or failed to load during SSO with email goodbye@example.com.
    11630 26/May 16:44 sso_connector Info Redirecting to IdP for authentication.

    With the user existing in both places, it redirects to the IDP login, and on save, redirects back to the SP site where I'm logged in.

  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    Hi, thanks @mortona2k, glad to hear it's working for you. Regarding the user synchronization, you should have the box checked in both IdP and SP, they are both checked and you still have that error?

  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    I have retested the whole process. I have fixed and refined some parts of the synchronization code, now it will work even if the user does not exist in the SP. Can you try with beta2 tag. Thanx!

  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I had the sync SP checkbox set on both sites.

    Still getting the same results in beta 2. I can log in with a synced account, but not if it's unsynced.

    I am also seeing this message intermittently:

    To log in to this site, your browser must accept cookies from the domain projects.mantra.lndo.site.

    I added both sites as exceptions for my browser cookies in firefox, but still see the warning.

  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    Hi @mortona2k, I have checked the problem you report and there should no longer be a problem with synchronization disabled. I have also overwritten the behavior of the cookie provided by the core to avoid this error. I'm going to create a new beta3 tag, can you test if the problem is solved? Thank you.

  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    It's still not working for me, same error.

    Can you add some debug logs or point me towards what to check?

  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    Hi @mortona2k, Can you give me more information about the problem, I have three websites with the module in place, and I don't get the same error you describe, as I have the latest beta version.
    If you need to check something, try to debug the SsoController.php, but the error you described above is fixed with the latest version, at least in my case.
    Try to give me some more information so I can help you, thanks!

  • Merge request !10Save synced user β†’ (Merged) created by mortona2k
  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    Got it working.

    In SsoController:loginUserByEmail, $this->userSync->synchronizeUser() would fire, but then the next line was returning an empty array, not the new user.

    It looks like it should get saved in $this->userSync->updateUserData(), but the $user instanceof UserInterface check fails because it gets an empty array.

    Saving the user in $this->userSync->synchronizeUser() gets it working, but there should be some other adjustment to the logic. I don't know if a new user entity could be presaved somehow so it gets returned in the lookup. If not, maybe saving it here is fine.

    Thanks for your work on this.

  • Status changed to Fixed 5 months ago
  • πŸ‡ͺπŸ‡ΈSpain cesarmsfelipe

    Thanks for your help and work @mortona2k, and sorry for the delay in replying. I hope the module works for you and I would appreciate if you have suggestions for improvements for it. Best regards!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024