The application I am developing is team collaboration tools. This software should prevent unauthorized access. In order to implement this, I've used user and password-based authentication with two roles available - standard user and administrator.
This was implemented entirely in Python by using SQLAlchemy for interacting with the database, and PyQt for the user interface. For authentication, I am calling User Management System to get a token:
Request Body:
{
"username": "messaing_platform",
"password": "132465"
}
Response Body:
{
"apiData": {
"navigationList": [],
"userId": "messaing_platform",
"userName": "messaing_platform",
"email": "messaing_platform@erainfotechbd.com",
"cellNo": "01255",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOiJjcyIsIm5iZiI6MTY1OTUyNzcxOCwiZXhwIjoxNjYwMTMyNTE4LCJpYXQiOjE2NTk1Mjc3MThasdasd9.4lkEv-TpwIyYcldXfKucy3ynewhbuUFgjtdnKm7ymjE",
"page": 0,
"pageSize": 0,
"searchString": null,
"skip": 0
},
"message": "Record has been saved.",
"isExecute": true,
"totalRecord": 0
}
Now, I want to save this token in the PyQT user interface and if the token is expired, then the user should be logged out from the application. How can I do that?