gpt4 book ai didi

azure - AdalServiceException : AADSTS70002: Error validating credentials. AADSTS50012:提供的客户端 key 无效

转载 作者:行者123 更新时间:2023-12-03 04:23:06 26 4
gpt4 key购买 nike

我尝试使用以下命令从我的 C# 控制台应用程序获取 rsa key (来自 azure)来加密文件(用于上传)

我认为我已经在 azure 上为我的应用程序设置了一切正常。Keys、Secret 和其他,但我总是遇到以下错误。

AdalServiceException: AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.

我在这里阅读了一些其他答案,但没有人可以帮助我。

StorageCredentials creds = new StorageCredentials(
ConfigurationManager.AppSettings["accountName"],
ConfigurationManager.AppSettings["accountKey"]);

CloudStorageAccount account = new CloudStorageAccount(creds, useHttps: true);
CloudBlobClient client = account.CreateCloudBlobClient();
CloudBlobContainer contain = client.GetContainerReference
(ConfigurationManager.AppSettings["container"]);
contain.CreateIfNotExists();


KeyVaultKeyResolver cloudResolver = new KeyVaultKeyResolver(GetToken);
var rsa = cloudResolver.ResolveKeyAsync("xxx",
CancellationToken.None).GetAwaiter().GetResult();

内部 Ausnahme 1:

AdalServiceException: AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.
Trace ID: 1af5b50e-b4fd-4fb6-b795-d1ddaa390400
Correlation ID: 87ab5cc5-5209-4074-af00-38ab385ae847
Timestamp: 2017-10-11 18:40:32Z

内在 Ausnahme 2:

HttpRequestException:  Response status code does not indicate success: 401 (Unauthorized).

内在 Ausnahme 3:

AdalException: {"error":"invalid_client","error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 1af5b50e-b4fd-4fb6-b795-d1ddaa390400\r\nCorrelation ID: 87ab5cc5-5209-4074-af00-38ab385ae847\r\nTimestamp: 2017-10-11 18:40:32Z","error_codes":[70002,50012],"timestamp":"2017-10-11 18:40:32Z","trace_id":"1af5b50e-b4fd-4fb6-b795-d1ddaa390400","correlation_id":"87ab5cc5-5209-4074-af00-38ab385ae847"}: Unknown error

最佳答案

我遇到了同样的问题,就我而言,我通过在 Key Vault 的访问策略设置中授予对已注册控制台应用程序的访问权限来解决该问题。

关于azure - AdalServiceException : AADSTS70002: Error validating credentials. AADSTS50012:提供的客户端 key 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46696092/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com