我正在创建一个多租户桌面应用程序,它将代表用户访问Azure和Microsoft online资源。
微软建议使用MSAL.NET对用户进行身份验证,但要对用户进行身份验证,我的应用程序需要传入应用程序id。
// applicationId = {GUID of registered, multi-tenant app}
IPublicClientApplication app = PublicClientApplicationBuilder
.Create(applicationId)
.Build();
// This prompts the user, asking for permission based on the scope
// and application-id.
AuthenticationResult result = await app.AcquireTokenInteractive(scopes)
.ExecuteAsync();
// Now the application has a bearer token.
string bearToken = result.AccessToken;
因为这个application-id是放入程序集中的,所以它也很容易提取,所以我必须假定它是公知的。
鉴于此,我如何防止恶意应用程序和程序集冒充我已注册的应用程序?在纯粹的桌面空间中,这有可能被阻止吗?
发布于 2021-09-29 22:01:30
尽管我不愿意承认这一点,但我不得不承认,没有万无一失的方法来阻止访问,可以做的最好的事情是:
用于对桌面应用程序( given).
即使所有这些都是在浏览器上完成的,同样的问题也同样存在,因为我们依赖于客户端的浏览器安装和扩展是没有恶意软件的。
https://stackoverflow.com/questions/69353999
复制相似问题