1

I'm relying on DefaultAzureCredential.GetTokenAsync to get access token and auth my app to put/get resouurces on Azure. But looks like it doesn't mention how to do a force refresh on the access token. Is there a way to do that?

KevinC
  • 57
  • 5
  • If I am not mistaken, token lifecycle is managed automatically by the SDK and it automatically gets a new access token as and when needed. Can you describe your use case for forcefully refreshing an access token? – Gaurav Mantri Jul 15 '21 at 02:13
  • @GauravMantri yeah true. Basically i do a PUT request on the resource and then try a GET but received access deny. This is due to the ARM role assignment cache. So I was told using a new access token on GET the resource it would also force a refresh on the ARM role assignment cache. – KevinC Jul 15 '21 at 02:39
  • Thanks for explaining. Getting a new access won’t solve the issue for you. I would recommend editing your question and describe the problem you’re facing or you can post a new question regarding that. – Gaurav Mantri Jul 15 '21 at 02:46
  • @GauravMantri. It does work for me. I will keep the question as it is. – KevinC Jul 15 '21 at 02:51
  • To give another scenario - making use of Privileged Identity Management for Azure AD Groups. We have Role based access assigned to Groups. If a user has already obtained a token before granting themselves membership in a group using PIM, the new group won't appear in their access token until it gets refreshed. This means that any requests to Azure resources don't have their full group membership. – Matthew Steeples Feb 27 '23 at 23:02

0 Answers0