daviewales commented on issue #7204:
URL: https://github.com/apache/arrow-rs/issues/7204#issuecomment-2692971261

   Thanks. I understand the hesitation to shell out to Azure CLI. On the other 
hand, this is a common behaviour of many Azure tools.
   
   Looking at the code, I think that the only Azure CLI command used is `az 
account get-access-token`.
   If shelling out is the only concern, it should be possible to inspect the 
tokens stored in `$AZURE_CONFIG_DIR/accessTokens.json`, where 
`$AZURE_CONFIG_DIR` is `~/.azure` by 
[default](https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration#cli-configuration-file).
   
   [This 
article](https://mikhail.io/2019/07/how-azure-cli-manages-access-tokens/) notes 
that this file contains both the latest `"accessToken"`, (60 minute expiry) and 
also a long lived (90 day) `"refreshToken"`.
   
   If the access token is expired, it should be possible to `POST` the refresh 
token to the `"_authority"` to get a fresh access token. For example, if the 
`"_authority"` is `https://login.microsoftonline.com/common`, then you should 
be able to get a new 60 minute access token by `POST`ing the refresh token to 
`https://login.microsoftonline.com/common/oauth2/v2.0/token`. Other parameters 
from the `accessTokens.json` may also be required. See this [SO 
post](https://stackoverflow.com/a/74076836) for an example.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to