• The user successfully authenticates in the idp and gets redirected back to WordPress. They go to the home page and are not logged in.

    1) How do I direct them back from the idp to other than the home page?

    2) If I go to a protected page like wp-admin, they are sent back to the idp but since they already authenticted there they do not have to reenter their credentials and are returned back to the WP site and successfully authenticated. Obviously, I want the user to be logged into WP immediately upon returning from the idp.

    Help?

    https://wordpress.org/plugins/saml-20-single-sign-on/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter lsilver

    (@lsilver)

    Anybody? Very frustrating. It’s not logging the user on immediately upon the redirect back from the idp.

    Hi Lloyd, sorry long time no talk to. You have to understand that the login is working – please note that the User HAS TO BE POINTED to a page REQUIRING AUTHENTICATION for the WordPress side of the Signin to work. That is why the RelayState URL is usually the /wp-admin/ location. Try this – Create a page that is secured (requires authentication) and point the return to that. If that works, then create a redirect on that page to point the person where you need them to be.

    PS. Please note that the page you create, secure it using the Standard WordPress page restriction tools – not some third party plugin – because you run the risk of the WordPress login process not being called.

    UPDATE:

    hi Lloyd – there actually is another solution that I found last night. if you add the ‘redirect_to’ parameter onto your URL that points to the Login page, when the SSO completes, it will redirect to the URL that you used for your ‘redirect_to’ paramater. Note- the ‘redirect_to’ parameter must be a full url (including domain). Works great! Fully tested! only works in 0.9.2 plugin version though..

    URL example:
    http://<wordpressurl.com>/wp-login.php?redirect_to=<full target url>

    Thanks.

    Thread Starter lsilver

    (@lsilver)

    Hmmm. Tried the redirect_to but that didn’t seem to work. Just sent me back to the homepage. Might be my use case. The page I’m trying to send them to is protected via a plugin, but I don’t think it works in the same way as something like the wp-admin page in terms of logging in and authenticating.

    What I had to do was hack the plugin file which isn’t great but it works. I added a Relay State parameter to the authsources.php file to send it to wp-admin and then within WordPress I’m redirecting all non-admins to my destination page if they try to go to wp-admin. It works though not pretty.

    On another note, do you know of any way to not require users to login on each visit? Tried to play with the cookie length but that didn’t seem to work. So once the browser window is closed, the user has to login versus being able to stay logged in to the WP site for longer using the built-in authentication.

    Thanks for your help. I couldn’t have got this setup without it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Not Logging In To WordPress Upon Immediate Return from IdP’ is closed to new replies.