I have some company website providing some information protected by azure AD. This works fine in the browser, but I would like to create some automation on command line.
If I copy the JWT from the browser and use it in the Authorization: Bearer header, I can also access that information perfectly fine.
I was also able to use az login to prove my identity on the command line.
What is the correct way to get a suitable JWT on command line in order to access the information?
I was thinking of something like:
az login
token=$(az ad get-new-jwt-token)
curl -H "Authorization: Bearer $token" myinfosite.company.com
If there is a better/different solution, I am open to that, too.
