Fix #423: Create userprofile during login if it does not already exist

Fixes #423.
This checks during login whether a UserProfile already exists and creates it if necessary.

I couldn't check whether it's working in the real environment with Kerberos authentication, but I manually deleted the UserProfile of a user and tried logging in. The UserProfile was created as expected.