I've configured an identity provider to use local accounts with usernames rather than passwords.
I have created a user with a Display Name, User Name, and Email.
I am able to select "Display Name" and "Email Address" application claims for all policies, but "User Name" is not an option. I have also confirmed that a username claim is not being provided to my application.
How can I configure Azure AD B2C such that it provides the username claim?
Unfortunately, the username isn't available yet for selection as a claim to pass down in the token. You should vote for this ask in the Azure AD B2C UserVoice forum to help prioritize it: Include username in JWT claims
Your only option as this time is to retrieve it yourself via the Graph.
Here's a quick & dirty snippet of .Net code that you can use for this:
You'll reference this method when you setup your OpenIdConnectAuthenticationOptions like so: