PHP and WordPress Single Sign On (SSO) with optional JWT Addon
- Edited
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.
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.
- Edited
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.
- Edited
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
yes going through documentation , thanks its very detailed
- Edited
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:
- Your login form gets processed and triggers the error after the SSO function, which has a priority of 35 in the WP filters system.
- 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.
- Edited
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:
- Upgrade to beta16 and use the latest SSO version
- 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)