WP Signon and set user via custom login SSO (Single-Sign-On)
-
I’m currently using the Function/API calls to wordpress in order to get my custom login to work.
I’m basically tying a regular php login, with the wordpress login. I’m using the following actions:
$creds = array(); $creds['user_login'] = $username; $creds['user_password'] = $password; $creds['remember'] = true; $user = wp_signon( $creds, false ); wp_set_current_user($user->ID);
This all seems to work well as just about all wp cookie settings are created:
Array ( [wp-settings-1] => editor=html&uploader=1&align=none&m1=o [wp-settings-time-1] => 1307032216 [wp-settings-time-2] => 1307046336 [wp-settings-2] => m3=o&m5=c&m1=c [wordpress_test_cookie] => WP Cookie check )
Obviously there’s a bug somewhere as the full wordpress login looks like this:
Array ( [wp-settings-1] => editor=html&uploader=1&align=none&m1=o [wp-settings-time-1] => 1307032216 [wp-settings-time-2] => 1307046336 [wp-settings-2] => m3=o&m5=c&m1=c [wordpress_test_cookie] => WP Cookie check [wordpress_logged_in_1307046336asdadasdasdsadasdas] => my_user|1307046336|asdadasiodjasdiasjasdasdsa )
The ‘wordpress_logged_in’ part is what allows the user to view the admin bar and not have to worry about logging in once again.
My question is how do you get wordpress to correctly create a correct login session via the api/function reference?
The above code should work per the documentations, but obviously doesn’t.
- The topic ‘WP Signon and set user via custom login SSO (Single-Sign-On)’ is closed to new replies.