Open rasmusei opened 2 years ago
@rasmusei Is this one a dubplication of https://github.com/buerokratt/Buerokratt-Chatbot/issues/36?
@turnerrainer #36 and #40 are different. #36 is about active chat between CSA and End User, #40 is about Administrative User session in Bürokrat back office
@rasmusei How does this task differ from #22 ?
@ceirowe Task #22 is about when Administrative User is idle or logs out manually. This task is about automatic prolongation of active session when Administrative User is logged in back office. AS IS functionality is that Admin can set the session length in back office for how long users sessions will be opened.
@rasmusei Should be able to use existing endpoint. JWT should be stored locally in customJwtCookie
.
curl -X POST --location "https://localhost:8445/cs-custom-jwt-extend" \
-H "Content-Type: application/json" \
-d "{}"
Extend response, unsuccessful (200)
{
"data": {
"custom_jwt_extend": null
},
"error": null
}
Extend response, successful (200)
{
"data": {
"custom_jwt_extend": "new jwt that should be stored in a cookie called customJwtCookie"
},
"error": null
}
Expiration time is set on initial login (/cs-login
), and the time in minutes is taken from the configuration
table. TIM is designed to take the original expiration time when extending with /cs-custom-jwt-extend
, so the jwt is always extended by the same amount as was set at the time of the initial login.
/cs-login
returns
{
"data": {
"custom_jwt_cookie": "the generated jwt"
},
"error": null
}
The validity is checked with /cs-custom-jwt-userinfo
. The body of the request is only the name of the cookie (set in the cs-login
conf) where the jwt is stored, between double quotes.
curl -X POST --location "https://localhost:8445/cs-custom-jwt-userinfo" \
-H "Content-Type: application/json" \
-d "\"customJwtCookie\""
The response payload, where JWTExpirationTimestamp
is the expiration time in epoch milliseconds
{
"data": {
"custom_jwt_userinfo": {
"firstName": "csaEesnimi",
"lastName": "csaPerekonnanimi",
"idCode": "EE60001019906",
"displayName": "sõbralik csa",
"JWTCreated": 1675863621000,
"login": "kasutajanimi",
"csaEmail": "sõbralik@csa.ee",
"authorities": [
"ROLE_CUSTOMER_SUPPORT_AGENT"
],
"csaTitle": "Aupaklik",
"JWTExpirationTimestamp": 1675870821000
}
},
"error": null
}
BUG-
BUG- @1AhmedYasser
When the bürokratt session time runs out it gives me a notification "sessioon aegunud" that says the session has ended. It should log me out, but I can still manage around the environment. It logs me out when I click on the X on the box.(look at the screenshot)
BUG- @1AhmedYasser
When the bürokratt session time runs out it gives me a notification "sessioon aegunud" that says the session has ended. It should log me out, but I can still manage around the environment. It logs me out when I click on the X on the box.(look at the screenshot)
You want it to be automatic logout ?
@1AhmedYasser yep
tested and done
done
AS AN Administrative User I WANT TO have my Bürokratt session automatically extended SO THAT I don't have to extend my session manually
Acceptance Criteria
GUI
DSL
User's activity validation
expiration time
)user activity period in seconds
) defined as a Ruuter DSL valueremaining jwt lifetime
) defined as a Ruuter DSL valuecurrent timestamp
-expiration time
is less thanremaining jwt lifetime
, make an additional request to validate if the user has been marked asonline
within a predefined time period (user activity period in seconds
) - OK / NOK