Hook handlers, attached to "onPluggableAuthUserAuthorization" hook - don't correctly get username of authenticated user.
Instead of correct username, some string like "0:0:0:0:1" is stored in user object after successful authentication.
After some debugging I found out that problem is here.
Method \User::loadDefaults() resets user object, then username and real name are updated.
Problem is that real name is updated with \User::setRealname() method which tries again to load user object before setting real name - here.
As a result - user object is being reset once more (here) after updating username inside of that object. So actually username is lost.
It can be fixed just changing order of updating user object.
We can set real name at first, and username after that.
That fixed specified issue for me.