The refresh token has expired due to inactivity

%3CLINGO-SUB%20id%3D%22lingo-sub-1876103%22%20slang%3D%22en-US%22%3EThe%20refresh%20token%20has%20expired%20due%20to%20inactivity%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1876103%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20add%20a%20team%20to%20an%20existing%20O365%20group%20using%20PnP-PowerShell%3C%2FP%3E%3CP%3EWhen%20I'm%20using%20the%20below%20PnP%20PowerShell%20cmd%20(this%20command%20uses%20my%20credentials%20from%20CredentialManager%20in%20Windows)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fxxx%0AAdd-PnPTeamsTeam%3C%2FPRE%3E%3CP%3ETo%20add%20a%20team%20to%20a%20O365%20group%20I%20get%20this%20error%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%22AADSTS700082%3A%20The%20refresh%20token%20has%20expired%20due%20to%20inactivity.%5Cu00a0The%20token%20was%20issued%20on%202020-05-02T07%3A49%3A52.9345328Z%20and%20was%20inactive%20for%2090.00%3A00%3A00.%7D%2C%22error.redirectUrl%22%3A%22%3CA%20href%3D%22https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fxxx%3Freauthid%3D2.MXwwfA.Ec3D%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fxxx%3Freauthid%3D2.MXwwfA.Ec3D%3C%2FA%3E%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhen%20using%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fxxx%20-UseWebLogin%0AAdd-PnPTeamsTeam%3C%2FPRE%3E%3CP%3EThe%20command%20works.%20But%20we%20do%20this%20in%20an%20automated%20process%20so%20we%20want%20to%20use%20CredentialManager%20credentials.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20tried%20to%20invalidate%20all%20tokens%20using%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fblog.enablingtechcorp.com%2Frevoke-all-user-sessions-for-azure-ad-and-office-365%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fblog.enablingtechcorp.com%2Frevoke-all-user-sessions-for-azure-ad-and-office-365%3C%2FA%3E%3C%2FP%3E%3CP%3EBut%20no%20luck%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20I%20can%20refresh%20or%20invalidate%20the%20token%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1876103%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I'm trying to add a team to an existing O365 group using PnP-PowerShell

When I'm using the below PnP PowerShell cmd (this command uses my credentials from CredentialManager in Windows)

 

Connect-PnPOnline -Url https://xxx.sharepoint.com/sites/xxx
Add-PnPTeamsTeam

To add a team to a O365 group I get this error

 

"AADSTS700082: The refresh token has expired due to inactivity.\u00a0The token was issued on 2020-05-02T07:49:52.9345328Z and was inactive for 90.00:00:00.},"error.redirectUrl":"https://xxx.sharepoint.com/sites/xxx?reauthid=2.MXwwfA.Ec3D"

 

When using:

 

Connect-PnPOnline -Url https://xxx.sharepoint.com/sites/xxx -UseWebLogin
Add-PnPTeamsTeam

The command works. But we do this in an automated process so we want to use CredentialManager credentials.

 

We tried to invalidate all tokens using:

https://blog.enablingtechcorp.com/revoke-all-user-sessions-for-azure-ad-and-office-365

But no luck

 

Is there any way I can refresh or invalidate the token?

 

0 Replies