繁体   English   中英

OneDrive oauth wpf 禁用自动登录浏览器

[英]OneDrive oauth wpf disable auto login browser

为了将我们的应用程序与 OneDrive 连接,我们使用 oauth login....

但是一旦登录后,它将重新使用我的凭据,我无法取消或使用其他帐户,它以某种方式被缓存。

我还尝试删除 Internet Explorer 缓存和 Cookies 但它仍然会登录。

    Uri uri = new Uri("https://login.microsoftonline.com/common/oauth2/v2.0/authorize?" +
        "&client_id=" + ClientId +
        "&response_type=code" +
        "&redirect_uri=" + RedirectUri +
        "&response_mode=query" +
        "&scope=offline_access%20Files.Read%20Files.Read.All%20Files.Read.Selected%20Files.ReadWrite%20Files.ReadWrite.All%20User.Read");
    WebBrowser.Navigate(uri);

现在有人如何在 c# 中解决这个问题?

要禁用单点登录,只需向请求 URI 添加一个参数:

"&prompt=select_account" 或 "&prompt=login"

参考: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM