# Default-role deleted after session expires

**URL:** <https://forum.keycloak.org/t/default-role-deleted-after-session-expires/24350>\
**Category:** Miscellanaeous\
**Tags:** authentication, identity-brokering, ldap, oidc\
**Created:** [February 1, 2024, 4:40pm UTC](https://forum.keycloak.org/t/default-role-deleted-after-session-expires/24350 "2024-02-01T16:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Airmane](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/airmane/32/9674_2.png) [@Airmane](https://forum.keycloak.org/u/Airmane)\
**Post date:** [February 1, 2024, 4:40pm UTC](https://forum.keycloak.org/t/default-role-deleted-after-session-expires/24350/1 "2024-02-01T16:40:36Z")

</div>

Hello,

I have built an application that uses keycloak for managing users and roles and AzureAD as an Identity provider and I am running into an issue since I updated from version 13 to 22. I managed to transfer my configuration, roles and mappers correctly. However, the ‘default-role’ is deleted for certain users when the session is timedOut. I have no issues when these users are first created in keycloak, the default role is mapped corrected at this moment. I suspect that the role mapper is not triggered correctly during session timeout due to an Idle SSO timeout policy in the AzureAd config. I had some useful information using these 2 links :

[[keycloak-user] User roles deleted after SSO idle session expires](https://lists.jboss.org/pipermail/keycloak-user/2019-March/017614.html),  
[Idle session timeout for Microsoft 365 - Microsoft 365 admin | Microsoft Learn](https://learn.microsoft.com/en-us/microsoft-365/admin/manage/idle-session-timeout-web-apps?view=o365-worldwide)

But I would Love for some help please.
