With a minor update to config, now see:
Notice Undefined index: user_pass in /wp-includes/user.php on line 1459
Catchable fatal error: Object of class stdClass could not be converted to string in /wp-includes/formatting.php on line 4669
The plugin seemed to be losing settings – once I added them via DEFINE, I began seeing more consistent results.
Hey synpress, what configs did you define? I am having the same issues!
Before I added these defines, I noticed that when navigating in/out of the admin settings, sometimes one or more setting would not be there. I also noticed the login action URL had an empty client id. That made me suspicious, so I added my OKTA application credentials in my wp-config.
define(‘OKTA_CLIENT_ID’,'<your_client_id_from_okta>’);
define(‘OKTA_CLIENT_SECRET’,'<your_okta_client_secret>’);
define(‘OKTA_ORG_URL’,'<your_okta_org_url>’);
Once I did that, I began seeing the right information populated. I still need to sort out some other issues with the redirection.
Hello,
I was having the same issue so I dig into the plugin code ; there’s a missing filter, or a problem with the code line 205 :
function Login ( $user ){
/*
Check to see if the user already exists
*/
if ( false === ( $user_id = username_exists( $user->preferred_username ) ) ){
/*
Create the user
*/
$username = $user->preferred_username;
//$username = apply_filters( 'okta_username', $user );
$user_id = wp_insert_user ( array(
'user_login' => $username,
'password' => wp_generate_password()
) );
if ( is_wp_error ( $user_id ) ) {
die( $user_id->get_error_message() );
}
}
I commented the filter okta_username : this filter is never called in the plugin, so the $username variable stay empty, and is used just after to create an user with this login. As WP doesn’t allow creating user with empty user_login, it throws an error.
I added instead $username = $user->preferred_username which is the email address of the okta account.
(the filter could be reactivated if we need to rewrite the username based on the user object returned by okta).
@zillowgroup : can you check on your side and maybe update your plugin ?
Plugin Author
Zillow
(@zillowgroup)
We pushed a fix for this. The idea is that you can add an okta_username filter if you want to use something other than the preferred_username, it just wasn’t implemented properly. Update your plugin and let us know if that clears up the issue. Thanks!