适用于 argocd cli 的 Azure AD SSO

问题描述 投票:0回答:1

我正在尝试编写一些 argocd 任务的脚本 - 即添加存储库,但我无法通过 cli 获得 SSO 工作,它通过 Web UI 工作得很好。我添加了 http://localhost:8085/auth/callback 作为我的应用程序注册的重定向 URI,但是在运行以下命令时出现错误:

$ argocd login argocd.foobar.local --sso --grpc-web                                                      
Opening browser for authentication
INFO[0002] RequestedClaims: map[groups:essential:true ]
Performing authorization_code flow login: https://login.microsoftonline.com/*************/oauth2/v2.0/authorize?access_type=offline&claims=%7B%22id_token%22%3A%7B%22groups%22%3A%7B%22essential%22%3Atrue%7D%7D%7D&client_id=**************&code_challenge=**************&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2Fauth%2Fcallback&response_type=code&scope=openid+profile+email+offline_access&state=rPJPPwlfYj
FATA[0004] oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.\r\nTrace ID: cb7f1c22-d02b-4229-b382-264e01b00200\r\nCorrelation ID: 8db27be0-ea53-447d-b268-0d5549322fb4\r\nTimestamp: 2022-02-10 23:30:33Z","error_codes":[7000218],"timestamp":"2022-02-10 23:30:33Z","trace_id":"cb7f1c22-d02b-4229-b382-264e01b00200","correlation_id":"8db27be0-ea53-447d-b268-0d5549322fb4","error_uri":"https://login.microsoftonline.com/error?code=7000218","claims":"{\"access_token\":{\"capolids\":{\"essential\":true,\"values\":[\"***********\"]}}}"}

我需要在 Azure 端配置某些内容才能实现此目的吗?或者我需要向我的 argocd cli 传递更多参数吗?

azure oauth-2.0 azure-active-directory argocd
1个回答
0
投票

您可能已经找到了解决方案,因为这是 2022 年的线程,但是如果人们偶然发现此问题并出现相同的错误,这是由于在 Azure AD 应用程序注册上配置的平台造成的

要解决此问题,您需要转到应用程序注册表,然后转到身份验证、添加平台,然后使用 http://localhost:8085/auth/callback 作为重定向 URI 添加移动和桌面应用程序

然后使用 argocd login 登录 --sso --grpc-web

© www.soinside.com 2019 - 2024. All rights reserved.