Provide an authentication and secrets mechanism for database access
In order to prevent people from having to paste connection strings into notebooks, we should have proper authentication support. This could include:
- Aliases for connection strings that can be referenced from with the
#!connectmagic command. - AAD auth flow.
It would be great if we could use the dotnet user-secrets tool with notebooks.
Thinking a little more broadly than databases, could we possibly get auth tokens via RequestInput and a specific value for inputTypeHint? VS Code extensions can provide authenticators, so if inputTypeHint was "token:github", the VS Code extension could get the GitHub auth provider (if installed) and try to get a token directly from that. We even have a good fall-back story, where if the requested auth provider isn't installed and we can't automatically get a token, we can simply prompt the user for a value. In the Jupyter Lab case we could simply fall back to the Jupyter method of prompting for input, and in the console/automation case, we could pull the value from a command line argument.
The input type hint system was intended to be used this way, so now it's hopefully just a matter of building the providers.
This work depends on #3567.