简体   繁体   English

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

[英]OneDrive oauth wpf disable auto login browser

For connecting our application with OneDrive we are using oauth login....为了将我们的应用程序与 OneDrive 连接,我们使用 oauth login....

But after logged in once it will reuse my credentials and i cannot cancel or use different account somehow it is cached.但是一旦登录后,它将重新使用我的凭据,我无法取消或使用其他帐户,它以某种方式被缓存。

I Also tried to delete Internet Explorer Cache and Cookies but still it will 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);

Anyone now how to solve this in c#?现在有人如何在 c# 中解决这个问题?

To disable Single sign on just add a parameter to the request URI:要禁用单点登录,只需向请求 URI 添加一个参数:

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

Reference: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow参考: 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