Is there a common .NET MAUI implementation for AccountManager / AccountAuthenticator?

Mikhail14521 0 Reputation points
2025-12-15T13:24:50.27+00:00

Hello team,

I have a question regarding authentication in .NET MAUI.

On Android there are built‑in classes such as AccountManager and AccountAuthenticatorActivity that allow applications to create accounts, list them in system settings, and obtain tokens. However, when I look at .NET MAUI I cannot find a common implementation or documentation for accessing AccountManager or using an AccountAuthenticator.

I understand that platform‑specific code can be used, but some of the Android classes are marked as deprecated, and I could not find clear guidance or examples on how this should be approached in MAUI. Ideally, I would like to be able to:

Create accounts programmatically and see them listed in the device’s system settings.

Handle cases where a user manually adds an account.

Use AccountManager to obtain tokens for those accounts.

Store tokens securely, respecting their lifetime (similar to cookies), so that after restarting the app the token can be picked up again.

If AccountManager is not recommended, what is the suggested way in .NET MAUI to store and manage tokens safely? For example, when using MSAL with Duende OpenID Connect, tokens need to be persisted and refreshed. I found a basic sample repo here: Duende + MSAL sample — but it does not cover integration with Android’s global account storage or other token storage.

So my main question is: Is there a general .NET MAUI implementation for accessing Android’s AccountManager and AccountAuthenticator, or is the recommended approach to avoid them entirely and rely only on MSAL with SecureStorage?

Thank you very much for your time, and apologies if I missed existing documentation or examples.

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.