You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are working to use Shibboleth plugin in our project and while testing mapping I noticed that numeric only username is not working correctly : The account get created the first time but the pluggin cannot get the user account on the second access.
$username = $_SERVER[$shib_headers['username']['name']];
$user = new WP_User($username);
By exemple, $username is '020201', the account exist (as seen through Wordpress admin) but new WP_User return a user 0 (not existing).
I investigated a bit and I think the problem is that new WP_User($username); and it's implementation is conflictual.
Usually the id (record id if I'm right) is the first parameter ( WP_User( $id [, $name [, $blog_id ] ] ); ) but there is a chunk of code in class-wp-user.php that redirect $id to $name if the parameter is not fully numeric (which make the call in Shibboleth works most of the time from what I understand). In our case, that means that Worpress try to find a user having the $id corresponding to the same value as $username.
Is there a voluntary scenario where Shibboleth Pluggin would have to work with worpress table user id? Maybe it should always work with username? If it's the case, maybe the code should be changed to (the documentation talk about empty, not sure if it's null or string empty that should be used).:
$user = new WP_User('', $username);
We can patch the problem by prefixing our id with a non-numeric part (or similar solutions) or handle our own local patch but I would think that the Shibboleth plugin could be corrected for this relatively minor issue.
Someone has a take on this?
Thanks for the plugin!
The text was updated successfully, but these errors were encountered:
Hello, thank you for reporting this issue. I released version 1.8 today to resolve this and other issues. I am the new maintainer of the plugin and all further work on the plugin will be done in a new GitHub repository. If you have any further issues, please don't hesitate to report them in the new repository.
Hello,
We are working to use Shibboleth plugin in our project and while testing mapping I noticed that numeric only username is not working correctly : The account get created the first time but the pluggin cannot get the user account on the second access.
By exemple, $username is '020201', the account exist (as seen through Wordpress admin) but new WP_User return a user 0 (not existing).
I investigated a bit and I think the problem is that new WP_User($username); and it's implementation is conflictual.
Usually the id (record id if I'm right) is the first parameter ( WP_User( $id [, $name [, $blog_id ] ] ); ) but there is a chunk of code in class-wp-user.php that redirect $id to $name if the parameter is not fully numeric (which make the call in Shibboleth works most of the time from what I understand). In our case, that means that Worpress try to find a user having the $id corresponding to the same value as $username.
Is there a voluntary scenario where Shibboleth Pluggin would have to work with worpress table user id? Maybe it should always work with username? If it's the case, maybe the code should be changed to (the documentation talk about empty, not sure if it's null or string empty that should be used).:
$user = new WP_User('', $username);
We can patch the problem by prefixing our id with a non-numeric part (or similar solutions) or handle our own local patch but I would think that the Shibboleth plugin could be corrected for this relatively minor issue.
Someone has a take on this?
Thanks for the plugin!
The text was updated successfully, but these errors were encountered: