简体   繁体   English

Okta 登录小部件检查用户是否已通过身份验证

[英]Okta Sign-in widget check if user is authenticated

I am integrating the Sign-in widget into the music store example.我正在将登录小部件集成到音乐商店示例中。 Using the widget I can sign in, and after successfull authentication I am redirected to the landing page.使用小部件我可以登录,并在成功验证后重定向到登录页面。 (using the code from the example page http://developer.okta.com/docs/guides/okta_sign-in_widget.html#creating-an-html-file-with-the-widget-code (使用示例页面中的代码http://developer.okta.com/docs/guides/okta_sign-in_widget.html#creating-an-html-file-with-the-widget-code

In the music store example, the Request.IsAuthenticated is true after login, but this isn't the case wen logging in using the widget.在音乐商店示例中,登录后 Request.IsAuthenticated 为真,但使用小部件登录时情况并非如此。 How can I check if a user is signed in after he's authenticated using the sign-in widget?在使用登录小部件进行身份验证后,如何检查用户是否已登录?

One way you can do it is to call getUserInfo() on the token一种方法是在令牌上调用getUserInfo()

oktaSignIn.authClient.token.getUserInfo().then(function(user) {
       console.log(user);
          }).catch(function(e){
            console.log(e);
          });

You can also use the introspect endpoint to validate the token 您还可以使用自省端点来验证令牌

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 asp.net web api 中的身份声明获取 JWT 身份验证的登录用户 - How to get JWT authenticated sign-in user from identity claims in asp.net web api 如何检查用户是否在Sitefinity小部件模板中登录(已验证)? - How to check if user is logged in (authenticated) in Sitefinity widget template? 如何检查用户是否在MVC中通过了身份验证 - How to check if a user is authenticated in MVC 检查是否已在IdentityServer 4中对用户进行身份验证 - Check if user is already authenticated in IdentityServer 4 如何在Web API 2中检查用户是否已通过身份验证 - How to check if user is authenticated in Web API 2 如果用户通过 Claims 的身份验证,如何签入 sharepoint? - How to check in sharepoint if user is authenticated by Claims? 无法点击登录按钮 - Unable to click on Sign-in button 使用ASP.NET Core身份验证和基于令牌的身份验证时,为什么要登录新用户? - Why sign-in a new user when using ASP.NET Core Identity and token-based auth? 以编程方式检查用户是否已通过Office 365 / CRM Online进行身份验证 - Programmatically Check if User Authenticated to Office 365/CRM Online 我应该如何检查用户是否在 MVC5 中通过了身份验证? - How should I check if a user is authenticated in MVC5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM