Currently the username for the internal IDM user for a social account is "<provider>.<userid>", for example "google.1230947w98rs" would be the username for a user that has logged in with Google and has the Google userid "1230947w98rs".
The username should be generated based on something more friendly. For example screen name for Twitter, and email for Google.
This requires adding the userid for the social account as an attribute on the user (or an additional credential type?). Basically we have to be able to lookup the IDM user given the provider and provider userid. It should also be possible to have more than one set of provider+providerUserId associated with each account (see https://issues.jboss.org/browse/KEYCLOAK-26).
Another thing to consider is what to do if the username already exists. This depends on whether or not the review details feature is enabled (see https://issues.jboss.org/browse/KEYCLOAK-25).