dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.27k stars 1.76k forks source link

WebAuthenticator relogin without showing loging dialog from OAuth Provider #26078

Open haeberle opened 3 days ago

haeberle commented 3 days ago

Description

I'm following this guide to implement the web authentication in a .net Maui application and it works well.

The user calls the WebAuthenticator for login, as shown in the example above, and successfully logs in. After some time, the user needs to log in again to the OAuth server to renew the access token in order to access backend services.

For this purpose, the WebAuthenticator is called again.

Expected Behavior: The WebAuthenticator opens the login dialog of the OAuth provider, and upon successful login, the backend server sends the tokens.

Actual Behavior: The WebAuthenticator performs the login directly without displaying the OAuth provider’s login dialog.

Assumption: The WebAuthenticator caches the login data, and the OAuth provider dialog is called with this cached information.

Solution: This behavior is not inherently bad for all use cases, but there should be an option to clear the WebAuthenticator’s cache.

Steps to Reproduce

Using the Maui Essential Demo

Link to public reproduction project repository

https://github.com/dotnet/maui/tree/main/src/Essentials

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No workaround

Relevant log output

Mirksar commented 1 day ago

Have you tried a Private authentication session?

haeberle commented 23 hours ago

No, according the docs, private session is for iOS only, have issue on Android platform.