Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass email address for User creation on CAS Authentication #9

Open
shaneonabike opened this issue Sep 6, 2024 · 0 comments
Open

Pass email address for User creation on CAS Authentication #9

shaneonabike opened this issue Sep 6, 2024 · 0 comments

Comments

@shaneonabike
Copy link

Hey there,

Thanks so much for building this great WP integration with CAS. in our situation, our network WP requires an email address for accounts to be created.

On line 484 of classes/wp_cassfiy_plugin.php you are doing the following:

$wordpress_user_id = WP_Cassify_Utils::wp_cassify_create_wordpress_user( $cas_user_datas[ ‘cas_user_id’ ], null );

The problem is that means that no email address is ever set on account creation even if one is passed by CAS.

I did this hack to make it work, but I’m sure there is a better way to pull it out of the mappings (or another method)

// Pass email address for creation or it fails
$email = (isset($cas_user_datas[’email’])) ? $cas_user_datas[’email’] : NULL;
$wordpress_user_id = WP_Cassify_Utils::wp_cassify_create_wordpress_user( $cas_user_datas[ ‘cas_user_id’ ], $email );

What do you think? Would it be possible to add the ability to pass the email address to the creation function instead of null?

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant