ASP.NET Identity 2 - injecting ISecureDataFormat<>

ぃ、小莉子 提交于 2019-12-06 05:10:26
Josh C

I solved the following error in SimpleInjector with the following mappings

container.Register<IDataSerializer<AuthenticationTicket>, TicketSerializer>();
container.Register<IDataProtector>(() => new DpapiDataProtectionProvider().Create("ASP.NET Identity"));

To figure out what serializer was used I noticed that the ISecureDataFormat generic parameter in the AccountsController was a AuthenticationTicket type. In checking the IDataSerializer namespace the TicketSerializer implements IDataSerializer.

To figure out IDataProtector I again looked in the IDataProtector namespace and found the implementation of the IDataProtectionProvider.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!