Search code examples
windows-community-toolkit

What is the replacement for IProvider.LoginAsync of Windows Community Toolkit 7.0.0


I have finally updated CommunityToolkit from 7.0 to 7.1. enter image description here

to:

enter image description here

The OneDrive login code used to be like this:

IProvider provider = ProviderManager.Instance.GlobalProvider;
if (provider == null)
{
    //Unable to initialize OneDrive connection;
}
else
{
    if (provider.State == ProviderState.SignedOut)
    {
        await provider.LoginAsync();
    }
}

Unfortunately, LoginAsync() is no longer available: enter image description here

What is the replacement for this method in CommunityToolkit 7.1?


Solution

  • The Visual Studio object browser for CommunityToolkit.Authentication shows that IProvider contains the method SignInAsync().