Solution to avoid double-hop from client > web service > SQL Server

非 Y 不嫁゛ 提交于 2019-12-01 06:21:40

No, this is not possible. The client process does not have access to the user password, and hence it cannot send it to the web service tier. The client would have to explicitly ask the user for its password. If the client process has the password and is willing to send it to the web service then, in theory, the WebService can create a token for that user/password (using LogonUser) and then connect to the SQL Server using that token. This so called solution is so riddled with multiple security problems that is not worth discussing. If your team insist on it, make a web service that does that, ask a team member to connect to it, and once you got hold of his credentials (he will send your service his password, remember?) connect to the exchange server and send a mail to the CEO with the text 'Fire me, I'm an Idiot'. Or change his direct deposit bank and account in HR. Use your imagination... I hope now is a bit clearer why going down the path you propose is a very bad idea.

Just use Kerberos.

BTW, if you need to authenticate to the back end due to government regulation, then bear in mind that authentication and audit always come with a 'non-repudiation' requirement, and sending the password to the web-service so it authenticates on your blatantly contradicts that requirement, since the web-service can do any operation it wants masquerading as the user. This is what Kerberos delegation is constrained delegation.

This couldn't be done. Think about it, if applications could simply generate security tokens in this manner, what good would it be? You'll need Kerberos to overcome this issue.

Edit: Also the runas analogy doesn't apply in the case of a client attempting to authenticate into two systems successively, since runas only requires a single hop, even when you switch the user.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!