简体   繁体   English

如何跟踪通过天蓝色广告通过用户身份验证的次数

[英]How to track number of times user has been authenticated via azure ad

I am using Azure Ad and ADAL.js for authentication of my application, I need to track the number of times the user has successfully visited the application. 我正在使用Azure Ad和ADAL.js进行我的应用程序身份验证,我需要跟踪用户成功访问该应用程序的次数。

  • if the user is visiting the application in the same session then it should be counted as 1 visit. 如果用户在同一会话中访问该应用程序,则应将其计为1次访问。

  • if the user browse the application in different session then it should be counted as second visit. 如果用户在不同的会话中浏览该应用程序,则应将其计为第二次访问。

Is there any event in ADAL.js that i can use? 我可以使用ADAL.js中的任何事件吗?

or i am thinking to store session-state(adal.session.state) value in the database, which i have monitored is changing if the user session is changed.i will then compare this value for every visit of user it value is changed then i will increase the number of visit and will also update the new session state value. 或者我正在考虑将session-state(adal.session.state)值存储在数据库中,如果用户会话已更改,我监视的值正在更改。然后我将针对每次访问的用户比较此值,然后更改该值我将增加访问次数,还将更新新的会话状态值。

i created two extra column in my database Visits, SessionStateValue Value 我在数据库访问中创建了两个额外的列,SessionStateValue值

Since i was getting session state value which adal.js was storing in the session storage so whenever user logs in to the system successfully, and there is no value present in SessionStateValue db column(which means user is logging for the first time) then i store the session state value in db and increase the visit count by 1. 因为我正在获取adal.js存储在会话存储中的会话状态值,所以每当用户成功登录系统时,SessionStateValue db列中都没有值(这意味着用户是第一次登录),那么我将会话状态值存储在db中,并将访问次数增加1。

When the user uses the application within same session(say a new browser tab is opened ), since the SessionStateValue value is present in db and matches with the Session state value of browser then no visit count is increased. 当用户在同一会话中使用该应用程序时(例如,打开了一个新的浏览器选项卡),由于SessionStateValue值存在于db中并且与浏览器的Session状态值匹配,因此不会增加访问次数。

If the user login in other session(browser closed and reopened or different browser is used) then session state value is changed and is appended to the SessionStateValue in db and visit count is increased by 1. 如果用户在其他会话中登录(关闭并重新打开浏览器或使用其他浏览器),则会话状态值将更改并附加到db中的SessionStateValue中,并且访问计数增加1。

this logic is used as long as the visit count is < 3. 只要访问次数小于3,就会使用此逻辑。

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

相关问题 使用经过身份验证的 Azure AD 用户对 CSOM 进行身份验证 - Authenticate CSOM using authenticated user of Azure AD 确定消息在 Azure 主题上出现的次数 - Determine the number of times a message has been on the Azure Topic 使用Azure Active Directory对用户进行身份验证后执行代码 - Executing code after user has been authenticated using Azure Active Directory 通过 Azure AD Workbench Redshift 进行身份验证的 iam 角色 - iam role authenticated via Azure AD Workbench Redshift 从.Net Web API中经过Azure身份验证的AD获取用户名 - Get user name from Azure authenticated AD in .Net Web API Azure Logic App - 如何调用Azure AD认证的API - Azure Logic App - how to call an API authenticated by Azure AD 通过Powershell将用户从另一个Azure AD添加到Azure AD - Add user to Azure AD from another Azure AD via powershell 如何跟踪资源不在主 Azure AD 存储中的已消耗请求数? - How to track the number of consumed requests whose resources are not in the main Azure AD storage? 检查分支被锁定的次数以及锁定的可能原因 Azure DevOps Rest API - Check the number of times a branch has been locked and possible causes of lock Azure DevOps Rest API 通过Azure AD中的API创建用户 - Create User via API in Azure AD
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM