An event or how can the user log out of the application be detected?

An event or how can the user log out of the application be detected?

nguyenphuhuy.co
Participant Participant
282 Views
2 Replies
Message 1 of 3

An event or how can the user log out of the application be detected?

nguyenphuhuy.co
Participant
Participant

Hi everyone. It seems this is not a common problem in the forum. I would like to mention a little bit about the job:

 

We built the Authentication suite for the plugin and linked it to a Revit user account so that they can fully perform the functionality the plugin grants (or some specified permissions). With a working version of Revit (2020/2021/2022/2023)

The problem occurs when the user is logged in as another user. Accessible through the Autodesk Desktop App. Our plugin doesn't prevent that.
I have investigated and traced the event to be aware of this change and to no avail.

Any help really makes sense.

Thank you everyone for reading!

0 Likes
Accepted solutions (1)
283 Views
2 Replies
Replies (2)
Message 2 of 3

ricaun
Advisor
Advisor
Accepted solution

I've been using the LoginUserId (https://www.revitapidocs.com/2017.1/8d3b257a-7b99-a6ee-b146-f635c35f425c.htm) and it works fine in my applications.


Unfortunately, it doesn't have an event to know if the user logs out or logs in, you could use the static IsLoggedIn (https://www.revitapidocs.com/2017.1/c0c31280-6f0c-e72d-3af7-30aa548155e5.htm) to check every second and trigger a custom event if the value changed.

 

I'm not sure how Autodesk Desktop App works with the LoginUserId and IsLoggedIn in Revit, probably everything is connected. I suppose if the user change in the Autodesk Desktop App gonna change in Revit too.

 

How does your Authentication work in Revit?

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 3 of 3

nguyenphuhuy.co
Participant
Participant

"How does your Authentication work in Revit?"

About your question. I didn't go with the team to solve this problem, just found that team members used Firebase as the initial approach, then EMS. 

It's good to apply your solution. Also I used the Idling event to be able to detect the application changes.
Maybe this can't give you a better view of what worked. Its source code is relatively long for presentation.

 

Thanks for helping!

0 Likes