• Extensions
  • PHP and WordPress Single Sign On (SSO) with optional JWT Addon

Sanyu ok, so I suppose you are on beta16. What do you get with this: get_avatar_url( $user, array( 'size' => 100 ) )?
This is the way the avatar URL is retrieved in the plugin

    maicol07

    echo get_avatar( get_current_user_id(), 50);
    echo get_avatar_url( get_current_user_id(), array( 'size' => 50 ) );
    echo get_avatar( $user, 50);
    echo get_avatar_url( $user, array( 'size' => 50 ) );

    I think it's showing a default gravatar image. It works with get_current_user_id() here.

      Sanyu will check it. I need to use the $user variable since I can't rely on current user (an admin can change a user profile too)

        maicol07

        Forgot to mention that I'm using a WP plugin to change the user avatar in front end: WP User Avatar

        Not sure if this plugin is causing the problem.

          Sanyu you can try to deactivate it and change the user image without it

            maicol07

            I deactivated the plugin and when I change the Gravatar image, the Flarum avatar will sync with it.
            But when I used another plugin to upload a local image in the admin dashboard (Simple Local Avatars), it still displays the Gravatar image.

            So it seems like it's not working with avatars uploaded locally and only with Gravatar.

              Sanyu Can you try this and tell me the result?

              get_avatar_url( wp_get_current_user(), array( 'size' => 100 ) )

                maicol07

                I get this link: https://secure.gravatar.com/avatar/a708c3ca26d4f321a42948c00a7252c2?s=50&d=retro&r=g
                get_avatar( wp_get_current_user(), 50); is showing a default gray Gravatar image.
                On Flarum the account still has the Gravatar retro image.

                  Sanyu can you try to change $user to $user_id on line 255 of the sso-flarum.php in the plugin folder? If this solves it, then I'll push it to the repo (and release a new version in the next days)

                    7 days later

                    could anyone share demo website where this extension is enabled with wordpress , i just want to test how it works

                    Really awesome features 🎉 .. i dont why i'm not using sso all these days. earlier i thought its complicated to integreate 😃

                    • Signup URL: URL where the user will be redirected when the Signup button is clicked
                    • Login URL: URL where the user will be redirected when the Login button is clicked
                    • Logout URL: URL where the user will be redirected when the Logout button is clicked
                    • Manage account URL (available in 1.8+): URL where the user will be redirected whenthe Manage Account button is clicked. This button shows up in the user settings only if this setting has a valid URL.
                    • Open account management in a new tab (available in 1.8+): Open the link of the Manage Account button in a new tab
                    • Remove login button: Removes the login button from Flarum frontend
                    • Remove signup button: Removes the signup button from Flarum frontend

                      Hari currently there isn't any demo website. You can always setup a sample one in XAMPP or other local web server (I recommend Laragon).

                      The settings you listed are the extension ones. In the docs there is a page in the side menu with all the info about the WP plugin

                      Hi!

                      I noticed that when I enter wrong info in the login form on my website, that the error block won't show up. This only happens when the SSO Flarum is enabled.

                      Normally it looks like this

                      But with the SSO plugin enabled, the page loads without the error block.

                      Do you know what could cause this problem?

                        Sanyu there are two cases:

                        1. Your login form gets processed and triggers the error after the SSO function, which has a priority of 35 in the WP filters system.
                        2. Your login form gets processed and triggers the error before the SSO function, which returns a blank error. I can easily fix this. I'll include that in the next update to avoid similar issues.

                          Hey one quick question, if we integrate SSO is there any option to disable entire flarum registration? I don't want flarum login fields

                          When user hits login or signup button he should goto wordpress login URL after authentication he will be redirected back to flarum

                          Instead of asking I can just try to install and test myself

                          But I'm stuck in beta 13 , I don't know how to install. I don't want to break my site

                          how to install for beta 13? Could let me know command

                            Hari yes, the main purpose of this extension is to use your own auth system. So Flarum login and signup is disabled when SSO is enabled and related buttons redirects to the URL you set in settings.
                            Currently, I support only the latest major version of the extension (and plugins). So you have two possibilities:

                            1. Upgrade to beta16 and use the latest SSO version
                            2. Use an older version, compatible with beta13, knowing that it can contain bugs and issues solved in newer releases. You won't get support here with an older version.

                            My personal advice: always try to use updated software (not only Flarum) 🙂