microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.32k stars 676 forks source link

Proposal: LoginDialog Control #799

Open shaggygi opened 5 years ago

shaggygi commented 5 years ago

Proposal: Add LoginDialog Control

Similar to #792, it would be nice to have a LoginDialog control similar to MahApps LoginDiagram for user to enter user/pass.

Summary

While devs can create their own, it is a little more complex as the PasswordBox control is harder to setup for MVVM binding due to security issues.

Instead of creating custom logic/UI, it would be nice to have a native control to perform basic login UI.

YuliKl commented 5 years ago

@shaggygi, thank you for the proposal and, again, more detail would be great. Would the only purpose of this control to enable users to enter their username/password while supporting MVVM, or would you want to see other scenarios covered?

shaggygi commented 5 years ago

@YuliKl Thanks for the reply. My initial thought it would purely for 1) MVVM support and 2) allow user to enter username/password. One disadvantage of only this is it would have to return back to caller to perform the verification. If the username/password failed, the dialog would have to be called again to inform user of error and retry.

I guess you could pass an authentication interface, but gets complicated as that would be known and if it would work for different scenarios.

In the end, I could get around this and create my own ContentDialog for this. However, it is the security and support for MVVM around the PasswordBox that would be good instead of coding.

mrlacey commented 5 years ago

This would be much easier to implement once #179 (native Input validation) is part of the platform. However, I'd be very cautious about providing such a control as it is likely that once an "official" login control is available it can be tempting for developers to use this as an excuse to delegate some of their responsibility for managing security and passwords appropriately. As this could easily lead to the production of less secure software careful consideration of this must be taken.

YuliKl commented 5 years ago

Thank you for your cautionary comment, @mrlacey! While a login dialog seems useful, I can definitely imagine a control like this turning into a crutch.

While we definitely won't be able to act on this proposal until after WinUI 3.0 ships, I would like to keep this issue in our "freezer" to be considered in the future.

mrlacey commented 5 years ago

@YuliKl I understand keeping it open ;) We still have a similar issue open for Windows Template Studio but I've very reluctant to actually implement it and we are instead focusing authentication efforts in WTS around web/MSAL based auth for now to avoid some of the potential issues here.

sigmarsson commented 2 years ago

Perhaps #4374 would facilitate to deal with credential providers and free you up from dealing with passwords ?