SOLVED

Password Expiry/Reset

%3CLINGO-SUB%20id%3D%22lingo-sub-2038481%22%20slang%3D%22en-US%22%3EPassword%20Expiry%2FReset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2038481%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20it%20possible%20to%20have%20when%20a%20user's%20password%20expires%20it%20logs%20that%26nbsp%3Buser%20out%20so%20they%20are%20forced%20to%20reset%20it.%20Currently%20the%20notification%20appears%20for%20the%20user%20but%20they%20only%20have%20to%20reset%20it%20when%20they%20log%20out%20and%20log%20back%20in.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20there%20is%20a%20way%20to%20manually%20sign%20user's%20out%20but%20I%20wonder%20if%20this%20can%20be%20done%20automatically%20on%20expiration%20of%20password.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2038481%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPassword%20Expiry%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Epassword%20reset%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2039137%22%20slang%3D%22en-US%22%3ERe%3A%20Password%20Expiry%2FReset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2039137%22%20slang%3D%22en-US%22%3E%3CP%3ESession%20validity%20is%20enforced%20by%20token%20validity%2C%20not%20directly%20by%20passwords.%20Password%20change%2Fexpiration%20will%20cause%20the%20refresh%20token%20to%20expire%2C%20but%20the%20user%20can%20still%20retain%20access%20for%20the%20validity%20of%20the%20access%20token%2C%20and%20we%20have%20no%20way%20to%20revoke%20those.%20It%20also%20depends%20on%20the%20account%20type%2C%20the%20service%20used%2C%20etc.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETL%3BDR%26nbsp%3B%20if%20you%20want%20thing%20to%20happen%20as%20fast%20as%20possible%2C%20best%20initiate%20the%20sign%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor

Is it possible to have when a user's password expires it logs that user out so they are forced to reset it. Currently the notification appears for the user but they only have to reset it when they log out and log back in. 

 

I know there is a way to manually sign user's out but I wonder if this can be done automatically on expiration of password.

2 Replies

Session validity is enforced by token validity, not directly by passwords. Password change/expiration will cause the refresh token to expire, but the user can still retain access for the validity of the access token, and we have no way to revoke those. It also depends on the account type, the service used, etc.

 

TL;DR  if you want thing to happen as fast as possible, best initiate the sign out.

Best Response confirmed by JamesCumberton (Visitor)
Solution

Hi @JamesCumberton,

 

Technically, you can. In our organization we wanted to force sign-out users when their accounts get disabled or passwords are reset/changed, and so instead of waiting for the Azure refresh token to expire we solved the situation by running the following cmdlet when that action occurs:

  Set-MsolUser -UserPrincipalName $User -StsRefreshTokensValidFrom (get-date)
 
The key is, you'll need an interceptor to trigger this action when the condition occurs. If your domain is federated, it's your your on-premise AD should have a interceptor that can catch when password change/password expiry/account disable happens, and then execute the MSOL cmdlet to revoke the Azure token (or like how we have done, place the script in an Azure runbook, create a webhook, and have the AD interceptor call the Webhook and pass the username).