Problems with refreshing auth tokens

Hello there!

I have “adopted” a Universal Dashboard from a former colleague, and now I am in need of some assistance getting the refresh auth tokens to work.

I suspect it might be because some changes in password, but I cant seem to figure out how to actually refresh the tokens.

To be honest, Im not really sure how to even troubleshoot this case, so I hope someone might be able to shine a light on this for me.

There are several functions that stopped working around the time my former colleague left, and as I mentioned, it could be because the passwords have changed, but how do I define a new user to authenticate the dashboard with?

For testing purposes I am using the partner center functionality. I am getting this error:

[Warn] PowerShellExecutionService Error executing endpoint RunForcedRefreshPartnerCenter. AADSTS50173: The provided grant has expired due to it being revoked, a fresh auth token is needed. The user might have changed or reset their password. The grant was issued on ‘2021-08-27T08:37:47.5579330Z’ and the TokensValidFrom date (before which tokens are not valid) for this user is ‘2021-10-01T06:34:20.0000000Z’.
Trace ID: bc56a9ea-745f-4c1c-8821-338999ce3f00
Correlation ID: 39aa9428-9b40-4f50-95eb-1e958e381e38
Timestamp: 2021-12-07 08:07:01Z
at , : line 20
at , : line 4
09:07:01 [Warn] PowerShellExecutionService Error executing endpoint RunForcedRefreshPartnerCenter. Run Connect-PartnerCenter to login.
at , : line 29
at , : line 4


have a look at the docs:

Now you need to figure out where the tokens are defined in the code and replace them with the new generated. There is no option for unlimited tokens, so you have to do this regularly

Hi and thanks for your swift reply.
The tokens seem to be saved in a key vault, and are defined like this:
“PartnerCenterRefreshToken”: {
“iv”: “”,
“hmac”: “”,
“payload”: “”

I’m gonna take a wild guess and say that’s some sort of encryption.
Will I have to apply the same sort of encryption in that case?

Also, I cant seem to find the admin panel described in the article, so I would have to use the commands.
I am unsure where to run these, but I can try in the admin terminal within the UD I suppose?

If im totally lost, please pardon me for being so. I am trying my best to learn this as quickly as possible =)

Just wanted to inform you all that this entire ordeal is now sorted out, and I have a much better understanding of how these things work than I had prior to this experience.
Thanks for the help! ^^

1 Like

So… I managed to mess it up again, and I managed to NOT write the solution here…
Classic case of # No comment. It was hard to write, it should be hard to read.

Thanks PAST me…
You were of great help.

Btw. Anyone have a good guide to simply renew a refresh token? :blush: