将 Azure App ID 实施到 C# 应用程序中的最佳方式

Best way to implement Azure App ID into C# application

我正在开发一个利用 OneDrive SDK nugget 的应用程序,它使用 Azure 的 App ID 来验证 API 调用。

我不确定实现该 ID 的最佳方法是什么,因为我找不到任何关于它是否应该以某种方式安全存储或者是否可以以更灵活的方式实现的信息(如纯文本到变量例如).

现在我将该信息存储在一个单独的文件中,该文件尚未上传到 github 存储库(因为它是一个开源项目),但我想知道这是否真的没有必要,因为它可以公开可用或有更好的方法来处理它,因为我以前没有使用过 Azure 门户。

在此先感谢您的帮助。

应用程序 ID/客户端 ID 并不是真正的秘密,但我认为共享它也没有任何好处:)

如果您的应用程序使用应用程序密钥/客户端机密,那么,这必须保密。

应用程序 ID 在登录请求中提交给 Azure AD URL,因此它可供登录您的应用程序的用户使用,但不能真正保密。

OAuth RFC的相关部分:

The authorization server issues the registered client a client identifier -- a unique string representing the registration information provided by the client. The client identifier is not a secret; it is exposed to the resource owner and MUST NOT be used alone for client authentication. The client identifier is unique to the authorization server.