gpt4 book ai didi

azure - 手动在 Azure AD 中注册新应用程序

转载 作者:行者123 更新时间:2023-12-03 03:08:30 24 4
gpt4 key购买 nike

我正在使用 VS 2015 创建具有 Azure AD 身份验证的新 Web 应用程序 (.NET core)。运行应用程序后,我看到 Azure AD 自动为我注册新应用程序。然后我就可以使用我的 Azure 用户成功登录。

但我想手动注册我的应用程序。因此我按照该网站上的说明进行操作: https://learn.microsoft.com/en-us/azure/active-directory/active-directory-app-registration

然后,我在 Azure AD 上手动注册新应用程序,然后将生成的客户端 ID 更新到我的 appsettings.json,然后使用 Azure 用户运行并登录。我收到错误消息:

An unhandled exception occurred while processing the request.

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

AggregateException: Unhandled remote failure. (Response status code does not indicate success: 401 (Unauthorized).)
MoveNext

有高手可以告诉我原因吗?我是 Azure 的新手。还有一个问题是我不知道为什么我的 appsetting.json 文件中没有 SecretKey?

This is the screen when I created the app

This is my appsetting.json file

最佳答案

此问题是由于当您将 appsettings.json 更改为第二个应用时应用的客户端 key 不正确而导致的。

敏感数据存储在用户配置文件目录中的 JSON 配置文件中:

Windows:%APPDATA%\microsoft\UserSecrets\\secrets.json

Linux:~/.microsoft/usersecrets//secrets.json

Mac:~/.microsoft/usersecrets//secrets.json

在 Secrets.json 中更改 ClientSecret 后,应用程序应该可以正常运行。

更多关于开发过程中安全存储应用 secret 的详细信息,您可以引用here .

关于azure - 手动在 Azure AD 中注册新应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42038715/

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