Relative Content

Tag Archive for c#encryptionblazorasp.net-identity

How can UserName’s ProtectedPersonalData attribute be overridden in ASP.NET Core Identity?

I’m using ASP.NET Core Identity in a Blazor project. I’d like to encrypt the user’s personal data, however, I don’t want to encrypt the UserName. My plan is to use the UserName as an account id rather than the user’s name. The user’s name will instead be held externally to the IdentityUser class and encrypted separately using a different encryption mechanism. This account id, which will be held in UserName, needs to be memorable, but not contain user identifiable data, so won’t need to be encrypted, it will just be like any normal login id. My hope is that, by not encrypting this account id, it will be possible for the user to recover their account under certain scenarios.