Azure-Samples / active-directory-dotnet-desktop-msgraph-v2

Sample showing how a Windows desktop .NET (WPF) application can get an access token using MSAL.NET and call the Microsoft Graph API or other APIs protected by the Microsoft identity platform (Azure Active Directory v2)
https://aka.ms/aadv2
MIT License
146 stars 98 forks source link

Mention prompt=select_account to avoid automatic re-signin #73

Closed Fabian1337 closed 1 year ago

Fabian1337 commented 3 years ago

should be same with ad

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.

    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);
Fabian1337 commented 3 years ago

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

jmprieur commented 3 years ago

you might want to add a prompt, @Fabian1337 (for instance prompt=select_account)

Fabian1337 commented 3 years ago

@jmprieur thanks for the fast answer, yes correctly therefore i closed the issue 👍 it was really hard to find this information :/

jmprieur commented 3 years ago

thanks for the feedback. Well add something in the README.md