[英]How to get JWT authenticated sign-in user from identity claims in asp.net web api
[英]Okta Sign-in widget check if user is authenticated
我正在將登錄小部件集成到音樂商店示例中。 使用小部件我可以登錄,並在成功驗證后重定向到登錄頁面。 (使用示例頁面中的代碼http://developer.okta.com/docs/guides/okta_sign-in_widget.html#creating-an-html-file-with-the-widget-code
在音樂商店示例中,登錄后 Request.IsAuthenticated 為真,但使用小部件登錄時情況並非如此。 在使用登錄小部件進行身份驗證后,如何檢查用戶是否已登錄?
一種方法是在令牌上調用getUserInfo()
oktaSignIn.authClient.token.getUserInfo().then(function(user) {
console.log(user);
}).catch(function(e){
console.log(e);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.