Idira Identity: Office 365 is requiring re-authentication frequently especially after a provisioning sync

Idira Identity: Office 365 is requiring re-authentication frequently especially after a provisioning sync

159
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 15:51 PM


Symptom


Office 365 is requiring re-authentication frequently, especially after a provisioning sync



Environment


20.7;21.1;21.2;21.3;21.4;21.5;21.6

Cause


This is due to the update of attribute "StsRefreshTokensValidFrom" for Azure users, Azure will required user to perform re-authentication whenever the attribute isupdated.

This attribute is related to LastPasswordChangeTimestamp, StsRefreshTokensValidFrom will be updated as well if LastPasswordChangeTimestamp is updated, in this case, Azure will consider user got a password changed and required re-authentication

If LastPasswordChangeTimestamp is set null during provisioning, Azure will assign current date/time to both StsRefreshTokensValidFrom & LastPasswordChangeTimestamp which will revoke refresh token which caused the re-authentication
Here is a documentation from Microsoft explaining the behaviour: https://docs.microsoft.com/en-us/troubleshoot/azure/active-directory/federated-users-forced-sign-in



Resolution


For AD Users
CyberArk Identity will only sync LastPasswordChangeTimestamp when "Enable Hybrid Exchange support" is checked on O365 provisioning page, it will fetch the value from AD attribute pwdLastSet

To check whether Identity connector is able to fetch pwdLastSet, add the following to provisioning script and Test for the affected user:
trace("pwdLastSet=" + source.Get('pwdLastSet'));
Here is an example for success fetch of pwdLastSet:
pwdlastset.png
If the value is null, it means the account running connector services does not have sufficient permission to read "pwdLastSet" in AD, please check the permission of the account and ensure it has permission to read pwdLastSet attribute


For Cloud Directory Users
LastPasswordChangeTimestamp does not exists for Cloud directory user. Hence by default it is setting "null" value to Office365 during provisioning

Workaround:
A possible workaround is to set a static timestamp to LastPasswordChangeTimestamp using provisioning script.
It is suggested to set a value earlier than the existing value so that no further re-authentication will be required.
e.g. destination.LastPasswordChangeTimestamp = "2020-07-30T09:25:07Z";

However there is one drawback is that when user changed their password, no re-authentication will be required as LastPasswordChangeTimestamp won't be updated.

To verify if the script is working as expected, check the value of LastPasswordChangeTimestamp and StsRefreshTokensValidFrom using powershell script:
1. Open Powershell
2. PS> connect-msolservice
3. Follow login prompt with an exchange or global admin
4. PS> Get-MsolUser -UserPrincipalName {UserNameHere) | Select-Object *
5. Check the values of LastDirSyncTime, LastPasswordChangeTimestamp, and StsRefreshTokensValidFrom.

The expected value is that after setting a static value LastPasswordChangeTimestamp and StsRefreshTokensValidFrom should have the same static value and no longer update on each sync, while LastDirSyncTime will update with each new sync. Without the script all 3 of these attributes update with each sync which is expiring any User Token older than the new values.



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000meBCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail