Breaking change: Add autoLogon parameter to OnSelected method

Modified the `OnSelected` method in the `CredentialTile` class to include an `out` parameter named `autoLogon`, which determines if the logon should proceed immediately. Updated XML documentation to explain the new parameter and its behavior in Windows 10. Adjusted the `SetSelected` method in `CredentialTile.ICredentialProviderCredential` to call the updated `OnSelected` method and set `pbAutoLogon` based on the returned `autoLogon` value. Removed the previous `OnSelected` implementation without parameters.

There was confusion between a tile that is configured as a default auto logon tile, and a tile that can be auto logged-on when selecteed. This change clarifies the case of a tile allowing login when selected, without having to press a submit button.
The AutoLogon propert of the CredentialTile object is no longer used in this scenario.
Implementers must override OnSelected(out bool autoLogon) to automatically logon a tile when selected
This commit is contained in:
Ryan Newington
2024-10-18 10:33:41 +11:00
parent 2e9e21aee6
commit 96bff2852a
2 changed files with 10 additions and 3 deletions
@@ -164,7 +164,14 @@ namespace Lithnet.CredentialProvider
/// <summary>
/// Called when the user selects this tile
/// </summary>
protected virtual void OnSelected() { }
/// <param name="autoLogon">A value that indicates if logon should be performed immediately, without waiting for further user input</param>
/// <remarks>
/// In Windows 10, if a credential provider wants to automatically log the user on in a situation Windows does not think is appropriate, the system will display a sign in button as a speed bump. One example of this is when a user with an empty password locks the computer or signs out. In that scenario, Windows does not directly log the user back in.
/// </remarks>
protected virtual void OnSelected(out bool autoLogon)
{
autoLogon = false;
}
/// <summary>
/// Called when a user deselects this tile