我想以编程方式设置注册策略的用户属性。我看到一年多前提出的上一个问题(将参数传递给注册策略)在当时是不可能的。这事有进一步更新吗?
这可以通过AuthenticationProperties.Dictionary属性实现吗?像这样的东西吗?
HttpContext.GetOwinContext().Set("Policy", Startup.SignUpPolicyId);
var authenticationProperties = new AuthenticationProperties();
authenticationProperties.Dictionary.Add("myattribute", "myvalue");
HttpContext.GetOwinContext().Authentication.Challenge(authenticationProperties);
Run Code Online (Sandbox Code Playgroud)