Use the preferred_username claim as the Mattermost username for OpenID Connect.
OpenID Connect (OIDC) has been added to the latest Mattermost Enterprise Edition. However, Mattermost seems to use the user's email address as the Mattermost username.
According to the OIDC specification, the standard response contains a preferred_username claim and the value of this field should be used as the user name.
When the preferred_username field of some IdPs is a mailbox (e.g. Google Login), only then is the mailbox prefix considered as the username.
Zero Clover shared this idea