tediousjs / tedious

Node TDS module for connecting to SQL Server databases.
http://tediousjs.github.io/tedious/
MIT License
1.56k stars 443 forks source link

[Q] Azure Active Directory Universal Support? #1200

Open heychazza opened 3 years ago

heychazza commented 3 years ago

Hi Contributors,

I'm looking to connect using my local Azure A.D. credentials, is this currently possible with Tedious? With SQL Server Management Studio it has the following option: image

Thanks.

arthurschreiber commented 3 years ago

@Chazza We don't have support for this built in, but it would be possible to add support for this. I think that the library we use for Azure AD authentication exposes methods for this authentication type.

I think we'd have to use the interactive method from here: https://github.com/Azure/ms-rest-nodeauth/blob/2ece38f40efeb50a4e2dd5dd887bab386cf808f4/lib/login.ts#L614-L618

Is this what you're looking for? 🙇‍♂️

We haven't implemented this yet, because the usefulness of interactive logins is limited when used for a server-side application.

heychazza commented 3 years ago

@Chazza We don't have support for this built in, but it would be possible to add support for this. I think that the library we use for Azure AD authentication exposes methods for this authentication type.

I think we'd have to use the interactive method from here: https://github.com/Azure/ms-rest-nodeauth/blob/2ece38f40efeb50a4e2dd5dd887bab386cf808f4/lib/login.ts#L614-L618

Is this what you're looking for? 🙇‍♂️

We haven't implemented this yet, because the usefulness of interactive logins is limited when used for a server-side application.

I'm, guessing this is when it opens a pop up for the user to enter credentials? If so, yes thats correct. When do you think this is able to be integrated, and yeah thats the only downside, how can this be gotten around? Any way perhaps to connect and store a session token. Would this work?