[MDEV-26714] Windows, command line clients - passwordless login using Windows credential manager Created: 2021-09-28  Updated: 2023-03-21  Resolved: 2023-01-16

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Fix Version/s: 11.0.1

Type: Task Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: Preview_11.0

Attachments: PNG File screenshot-1.png    

 Description   

*Credential Manager is standard way to store secrets, e.g password on Windows. It is much more secure as storing that stuff in config file, password can be stored for current Windows user,
per user:host:port combination.

Windows uses this password manager itself, e.g for teminal service client mstsc, but also 3rd party, like git client make use of it. It is very handy way to store once and forget, but also the passwords there could be looked up, and changed in credential manager itself.

Note, if password does not work, e.g was changed, this needs to be caught in the client, the stored password must be removed, and maybe user should be notified.

A setting whether to use credential manager, could be stored in my.ini

The implementation should allow easy integration of platforms other than Windows, e.g on macOS has keychain API which could be used for that same purpose.

Definitions

Interactive login happens when client passes -P option, which results into "Enter password:" prompt.

Implementation details

  • The credential manager is not used at all, if parameter credential_manager=OFF (that's default). The behavior described below only only takes effect if credential_manager=ON.
  • Reading from credential manager :
    the password is _read_by from credential manager, if either no --password is supplied on the command line, or interactive login requested with -P. If credentials are read, interactive prompt ("Enter password") is not shown.
  • Removing entry from credential manager:
    If stored password turns out to be wrong (e.g password was updated), and login attempt fails, then stored password is removed from credential manager. If client was started with interactive login, second login attempt will be made, after showing the prompt.
  • Adding entry to credential manager
    If interactive login succeeds, and password was not yet stored, then password is stored


 Comments   
Comment by Oleksandr Byelkin [ 2022-12-15 ]

review

Comment by Oleksandr Byelkin [ 2022-12-15 ]

After fixing description (we have discussed) it should be good

Comment by Lena Startseva [ 2023-01-11 ]

Testing in branch bb-10.11-wlad-MDEV-26714 done, all bugs are fixed. wlad, rebase, please on preview-11.0-preview

Comment by Lena Startseva [ 2023-01-12 ]

Testing after rebase on preview-11.0-preview done, everything good, task can be merged.

Generated at Thu Feb 08 09:47:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.