AddIdentityCore and IDataProtectorProvider in .NET Identity

59 Views Asked by At

When using .NET Identity, while registering services, if I call AddDefaultTokenProviders method after using AddIdentityCore it throws this error:

System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.AspNetCore.Identity.DataProtectorTokenProvider)

But if I call it with AddIdentity is works fine.

I generally understand difference between the two, and I've looked into source code for both but I just can't seem to find what specifically doesn't work for DataProtectorTokenProvider with first approach. Is there a way of making AddIdentityCore work with default token providers? And what exactly is the difference?

0

There are 0 best solutions below