Maybe name this loginUID and move the $backend code out of this. Than it could also be reused by other auth interfaces