SSO Wordpress plugin integration

For Plugin WordPress-Social-Login use this function to get avatar url:
function get_user_avatar_url()
{ $current_user = wp_get_current_user(); global $wpdb; $avatar_url = $wpdb->get_var( 'SELECT meta_value FROM '.$wpdb->usermeta.' WHERE meta_key = "wsl_current_user_image" AND user_id="'. $current_user->ID .'"'); if (!$avatar_url) { $avatar_url = get_avatar_url( $current_user->user_email, 32 ); } return $avatar_url; }

For WordPress you need to get url of "avatar" from db or upload a folder and set it in payload:
$current_user = wp_get_current_user();
        $payload = [
            'user' => $current_user->user_login,
            'email' => $current_user->user_email,
            'avatar' => get_user_avatar_url()
        ];
Add in payload parameter "avatar" with the image of url and inform support team that you will use the avatar for SSO by a shortname:

For example:
 $payload = [
            'user' => YOUR_USER_NAME,
            'email' => YOUR_USER_EMAIL,
            'avatar' => YOUR_USER_AVATAR_URL
        ];

Happy commenting!
SolidOpinion

Feedback and Knowledge Base