|
@ -316,8 +316,9 @@ _azure_getaccess_token() { |
|
|
|
|
|
|
|
|
if [ "$arc" = true ]; then |
|
|
if [ "$arc" = true ]; then |
|
|
response="$(_get http://localhost:40342/metadata/identity/oauth2/token\?api-version=2019-08-15\&resource=https://management.azure.com/)" |
|
|
response="$(_get http://localhost:40342/metadata/identity/oauth2/token\?api-version=2019-08-15\&resource=https://management.azure.com/)" |
|
|
T=$(cat $HTTP_HEADER | grep Www | sed 's/Www-Authenticate: Basic realm=//g' | sed 's/[^a-zA-Z0-9\/\.\-]//g') |
|
|
|
|
|
export _H2="Authorization: Basic $(cat $T)" |
|
|
|
|
|
|
|
|
CHALLANGE=$(cat "$HTTP_HEADER" | grep Www | sed 's/Www-Authenticate: Basic realm=//g' | sed 's/[^a-zA-Z0-9\/\.\-]//g') |
|
|
|
|
|
_H2="Authorization: Basic $(cat "$CHALLANGE")" |
|
|
|
|
|
export _H2 |
|
|
response="$(_get http://localhost:40342/metadata/identity/oauth2/token\?api-version=2019-08-15\&resource=https://management.azure.com/)" |
|
|
response="$(_get http://localhost:40342/metadata/identity/oauth2/token\?api-version=2019-08-15\&resource=https://management.azure.com/)" |
|
|
else |
|
|
else |
|
|
response="$(_get http://169.254.169.254/metadata/identity/oauth2/token\?api-version=2018-02-01\&resource=https://management.azure.com/)" |
|
|
response="$(_get http://169.254.169.254/metadata/identity/oauth2/token\?api-version=2018-02-01\&resource=https://management.azure.com/)" |
|
|