[英]google cloud IAM workload identity federation with azure ad 'app registration'/'enterprise applications'
我正在嘗試設置 Azure AD 'Enterprise Application' 以從 myapps.microsoft.com 訪問谷歌雲以獲取身份和訪問權限。
我按照https://cloud.google.com/iam/docs/configuring-workload-identity-federation#azure中的描述設置了工作負載身份聯合,但是身份驗證無法正常工作,並出現以下錯誤。
gcloud auth login --cred-file="/Users/pavan-mac/Downloads/clientLibraryConfig-aad-oidc.json"
ERROR: gcloud crashed (TransportError): HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fiam.googleapis.com%2Fprojects%<removed>%2Flocations%2Fglobal%2FworkloadIdentityPools%2Faad-integration%2Fproviders%2Faad-oidc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7feb69c80a10>: Failed to establish a new connection: [Errno 60] Operation timed out'))
2個問題:
由於您在 Azure 虛擬機之外使用 CLI,因此您無權訪問 Azure 托管標識。 這就是元數據服務器169.254.169.254//metadata/identity/oauth2/token錯誤的原因
Workload Identity Federation 的要求/選項之一是為您運行 Google Cloud CLI 的資源創建或分配托管身份。
要讓應用程序獲取 Azure AD 應用程序的訪問令牌,您可以使用托管身份
在此 Google 文檔中演示了一個技巧,需要您自己從 Azure 實例元數據服務獲取訪問令牌並將其粘貼到斷言中。 我沒有嘗試過這種技術,但這意味着每次令牌過期時,您都需要重復該過程。
curl \
"http://169.254.169.254/metadata/identity/oauth2/token?resource=APP_ID_URI&api-version=2018-02-01" \
-H "Metadata: true" | jq -r .access_token
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.