草庐IT

c# - 无法从 apicontroller 中的 OwinContext 获取 UserManager

我正在按照Microsoft示例使用Identity2.0.0实现电子邮件验证我卡在这部分了publicApplicationUserManagerUserManager{get{return_userManager??HttpContext.GetOwinContext().GetUserManager();}privateset{_userManager=value;}}这在controller中有效,但HttpContext在ApiController中不包含任何GetOwinContext方法。所以我尝试了HttpContext.Current.GetOwinContext()

c# - 无法从 apicontroller 中的 OwinContext 获取 UserManager

我正在按照Microsoft示例使用Identity2.0.0实现电子邮件验证我卡在这部分了publicApplicationUserManagerUserManager{get{return_userManager??HttpContext.GetOwinContext().GetUserManager();}privateset{_userManager=value;}}这在controller中有效,但HttpContext在ApiController中不包含任何GetOwinContext方法。所以我尝试了HttpContext.Current.GetOwinContext()

c# - 找不到 OWIN HttpListener

当我尝试开始时:WebApp.Start(newStartOptions{Port=9956,ServerFactory="Microsoft.Owin.Host.HttpListener"});我得到以下异常。根本原因可能是什么?System.MissingMemberExceptionwascaughtHResult=-2146233070Message=Theserverfactorycouldnotbelocatedforthegiveninput:Microsoft.Owin.Host.HttpListenerSource=Microsoft.Owin.HostingStac

c# - 找不到 OWIN HttpListener

当我尝试开始时:WebApp.Start(newStartOptions{Port=9956,ServerFactory="Microsoft.Owin.Host.HttpListener"});我得到以下异常。根本原因可能是什么?System.MissingMemberExceptionwascaughtHResult=-2146233070Message=Theserverfactorycouldnotbelocatedforthegiveninput:Microsoft.Owin.Host.HttpListenerSource=Microsoft.Owin.HostingStac

c# - OWIN 的 GetExternalLoginInfoAsync 总是返回 null

我创建了一个新的MVC5Web应用程序,当我尝试使用Google或Facebook登录时,调用了AccountController中的ExternalLoginCallback操作,但是GetExternalLoginInfoAsync()始终返回null:varloginInfo=awaitAuthenticationManager.GetExternalLoginInfoAsync();if(loginInfo==null){returnRedirectToAction("Login");}因为它始终为空,所以它只是重定向回登录页面并重新开始该过程。我该如何解决这个问题?

c# - OWIN 的 GetExternalLoginInfoAsync 总是返回 null

我创建了一个新的MVC5Web应用程序,当我尝试使用Google或Facebook登录时,调用了AccountController中的ExternalLoginCallback操作,但是GetExternalLoginInfoAsync()始终返回null:varloginInfo=awaitAuthenticationManager.GetExternalLoginInfoAsync();if(loginInfo==null){returnRedirectToAction("Login");}因为它始终为空,所以它只是重定向回登录页面并重新开始该过程。我该如何解决这个问题?

node.js - OWIN Katana 与 Node.js 性能基准测试

关闭。这个问题需要更多focused.它目前不接受答案。想要改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭5年前。ImprovethisquestionOWINKatana和Node.js哪个是可靠的性能基准?我对所有已经用Katana测试和尝试过的东西都非常感兴趣。 最佳答案 Haney做了someresearch对此,您可能会发现它很有用: 关于node.js-OWINKatana与Node.js性能基准测试,我们在StackOverflow上找到一

node.js - OWIN Katana 与 Node.js 性能基准测试

关闭。这个问题需要更多focused.它目前不接受答案。想要改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭5年前。ImprovethisquestionOWINKatana和Node.js哪个是可靠的性能基准?我对所有已经用Katana测试和尝试过的东西都非常感兴趣。 最佳答案 Haney做了someresearch对此,您可能会发现它很有用: 关于node.js-OWINKatana与Node.js性能基准测试,我们在StackOverflow上找到一

如何将OWIN身份验证与Microsoft帐户使用?

目前,我在应用程序中使用OWIN身份验证。我将租户用作常见。因此,它正在验证AzureActiveDirectory和Microsoft帐户的任何用户。我只想限制用户对Microsoft帐户。以下是我的web.config文件"/>来自startup.cs的代码publicclassStartup{//TheClientIDisusedbytheapplicationtouniquelyidentifyitself//toAzureAD.stringclientId=System.Configuration.ConfigurationManager.AppSettings["ClientId"

c# - Owin 声明 - 添加多个 ClaimTypes.Role

我有一个可以为用户分配以下角色的应用程序:super管理员管理员用户一个用户可能分配了两个或多个角色,例如。super管理员和用户。我的应用程序使用声明,因此我也想通过声明来验证用户角色。喜欢:[Authorize(Roles="Admin")]不幸的是,我不知道如何向我的ClaimTypes.Role添加多个角色。我有以下代码:varidentity=newClaimsIdentity(new[]{newClaim(ClaimTypes.Name,name),newClaim(ClaimTypes.Email,email),newClaim(ClaimTypes.Role,"User