lsp-mssql icon indicating copy to clipboard operation
lsp-mssql copied to clipboard

Authentication with Entra ID?

Open tsoernes opened this issue 1 year ago • 1 comments

Is it possible to connect to a database and authenticate with Microsoft Entra ID?

tsoernes avatar Aug 20 '24 11:08 tsoernes

I wrote a small function for myself to do that. I would guess you can also use other types of logins, change AUTHENTICATION appropriately.

(defun my-lsp-mssql-connect ()
      (interactive)
      (lsp)
      (lsp-mssql-connect
       (list
        :server (swb--get-default-host)
        :connectionString
        (format "SERVER=%s;DATABASE=%s;UID=%s;PWD=%s;AUTHENTICATION=ActiveDirectoryServicePrincipal"
               ;;; somehow fill these values in, `swb` is my own personal internal functions to get credentials.
                (swb--get-default-host)
                (swb--get-default-database)
                (swb--get-default-user)
                (swb--get-default-password)))))

Fuco1 avatar Aug 24 '24 14:08 Fuco1