草庐IT

isAuthenticated

全部标签

javascript - Node.js、Vue.js 和 Passport.js。 .isAuthenticated() 总是返回 false?可能是 Axios header ?

我正在将一个项目转移到Vue.js,但我无法让我的任何中间件检查用户是否已登录或检查用户对工作的所有权。经过无休止的搜索,我认为问题是我从客户端发送到服务器的header不包含Passport序列化用户或其他内容?我怎样才能使它工作?这是我在后端的登录路径:router.post("/login",function(req,res,next){if(!req.body.username||!req.body.password){res.send("Error");}elseif(req.body.username.length>40||req.body.password.length>

javascript - CoffeeScript:使用函数绑定(bind)的内联调用委托(delegate)

我有以下CS代码片段:classCtrlconstructor:(@security)->...isAuthenticated:->@security.isAuthenticated()翻译成以下JS:Ctrl=(function(){functionCtrl(security){this.security=security;...}Ctrl.prototype.isAuthenticated=function(){returnthis.security.isAuthenticated();};})()如您所见,isAuthenticated是对security对象方法的简单委托(de

c# - ASP.Net Identity Identity.IsAuthenticated 保持为真,即使在删除用户之后

我按照此处的示例代码实现了ASP.NetIdentity:https://github.com/rustd/AspnetIdentitySample在我的实现中,我检查用户是否经过身份验证——这是从我的MVCController上的FilterAttribute调用的;这个想法是我想在提供页面之前确认它们仍然是授权的。所以在我的过滤器中,最终会调用以下代码:_authenticationManager.User.Identity.IsAuthenticated;_authenticationManager在这里:privateIAuthenticationManager_authent

c# - Razor View IsAuthenticated 未按预期工作

我创建了一个简单的MVC应用程序,该应用程序使用新项目随附的.NetMembershipProvider。我正在尝试让标签正确显示。我可能不明白这一点,但这是我的代码:@ViewBag.TitleSuburbanCustomerPortal@Html.Partial("_LogOnPartial")@if(Request.IsAuthenticated){@Html.ActionLink("ChangePassword","ChangePassword","Account")}else{@Html.ActionLink("Logon","Logon","Account")@Html.A

javascript - React - 处理登录和身份验证的最佳方式是什么?

新的react和使用身份验证/登录的应用程序的工作。它目前工作但感觉一起被黑了。现在我的isAuthenticated状态位于我的routes.js中,如下所示:classRoutesextendsComponent{constructor(props){super(props);this.state={isAuthenticated:false,}}在我的登录页面上,我需要知道用户何时通过身份验证才能将他们重定向到home页面。允许访问和操作此isAuthenticated状态的最佳设计模式是什么?我目前的设置方式是我有一个函数可以在routes.js中设置状态并将状态作为prop发

ios - GKLocalPlayer 身份验证不起作用,但 isAuthenticated 返回 YES(Game Center 沙箱)

我正致力于在我的游戏中集成回合制比赛,几天前我开始从GameKitAPI收到奇怪的错误,提示本地玩家未通过身份验证,尽管他已经通过身份验证。当我启动应用程序时,authenticateHandler被调用,ViewController被显示,输入密码后,authenticaHandler被再次调用,本地播放器似乎得到认证。isAuthenticated返回YES。但是,一旦我开始使用任何GameKitAPI,例如loadFriendsWithCompletionHandler:,就会返回一个错误,指出玩家尚未通过身份验证。这是处理身份验证更改的代码。[[GKLocalPlayerloc

redis - Servicestack Authentication IsAuthenticated 始终为 false

您好,我正在尝试使用servicestack提供的OAuth身份验证plugins.Add(newAuthFeature(()=>newAuthUserSession(),newIAuthProvider[]{newBasicAuthProvider(),newLinkedInOAuth2Provider(newAppSettings()),newGoogleOAuth2Provider(newAppSettings())}));//UseRedisRepovaruserRepository=newRedisAuthRepository(redisClientsManager);con

redis - Servicestack Authentication IsAuthenticated 始终为 false

您好,我正在尝试使用servicestack提供的OAuth身份验证plugins.Add(newAuthFeature(()=>newAuthUserSession(),newIAuthProvider[]{newBasicAuthProvider(),newLinkedInOAuth2Provider(newAppSettings()),newGoogleOAuth2Provider(newAppSettings())}));//UseRedisRepovaruserRepository=newRedisAuthRepository(redisClientsManager);con

c# - Request.IsAuthenticated 始终为 false

你能告诉我为什么FormsAuthentication.SetAuthCookie(user.Name,false);没有导致Request.IsAuthenticated为真吗?这是我的代码:[HttpPost]publicActionResultLogIn(karcioszki.Models.UserLoginModeluser){if(ModelState.IsValid){if(IsValid(user.Name,user.Password)){FormsAuthentication.SetAuthCookie(user.Name,false);returnRedirectTo

c# - Request.IsAuthenticated 始终为 false

你能告诉我为什么FormsAuthentication.SetAuthCookie(user.Name,false);没有导致Request.IsAuthenticated为真吗?这是我的代码:[HttpPost]publicActionResultLogIn(karcioszki.Models.UserLoginModeluser){if(ModelState.IsValid){if(IsValid(user.Name,user.Password)){FormsAuthentication.SetAuthCookie(user.Name,false);returnRedirectTo