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:
@@ -66,8 +66,8 @@ namespace Lithnet.CredentialProvider
|
|||||||
{
|
{
|
||||||
this.logger.LogTrace("SetSelected");
|
this.logger.LogTrace("SetSelected");
|
||||||
this.IsSelected = true;
|
this.IsSelected = true;
|
||||||
pbAutoLogon = this.IsAutoLogon ? 1 : 0;
|
this.OnSelected(out bool autoLogon);
|
||||||
this.OnSelected();
|
pbAutoLogon = autoLogon ? 1 : 0;
|
||||||
return HRESULT.S_OK;
|
return HRESULT.S_OK;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -164,7 +164,14 @@ namespace Lithnet.CredentialProvider
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the user selects this tile
|
/// Called when the user selects this tile
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Called when a user deselects this tile
|
/// Called when a user deselects this tile
|
||||||
|
|||||||
Reference in New Issue
Block a user