我认为您的身份验证无效。
- 您需要一个令牌。您可以使用OpenID生成(请参阅docs)。
- 使用令牌(通过标头授权),您可以向API发出请求。
例:
获取令牌
data = {"username": "username", "password": "password", "client_id": "client_id", "client_secret": "client_secret", "grant_type": "password"}token = request.post("https://{server-url}/"realms/{realm-name}/protocol/openid-connect/token", data=data)要求API
response = requests.get("https://mylink.com/auth/admin/realms/{myrealm}/clients/{myclientid}/client-secret", data=data, headers= {"Authorization": "Bearer " + token.get('access_token'), "Content-Type": "application/json"})


