Answered by:
How to impersonate a user after getting credentials from SSS?

Question
-
Hi,
I have a web service which retrieves data from a database. In this web service (deployed to layouts) I've obtained credentials from the SSS. Now I would like to impersonate the credentials obtained from the SSS, so that the context in which i send queries to the database are done in these credentials.
Any help much appreciated.
Tuesday, January 24, 2012 10:27 PM
Answers
-
I think these 2 posts will be of help:
http://msdn.microsoft.com/en-us/library/ie/ee556780.aspx
http://msdn.microsoft.com/en-us/library/ie/ff798272.aspx
- Sid- Marked as answer by mortenbpost Wednesday, January 25, 2012 10:46 AM
Tuesday, January 24, 2012 11:04 PM -
The blog post below shows you how to call the SSS and use the credentials to call a web service.
http://sharepointfieldnotes.blogspot.com/2010/12/using-sharepoint-2010-secure-store.html
You can also use the Windows SDK Logon call to login as that particular user and execute a query to the database. Or if your database support SQL Authentication you can construct a connection string that uses the user name and password to connnect to the database.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa378184(v=vs.85).aspx
http://www.connectionstrings.com/sql-server-2008
Blog | SharePoint Field Notes Dev Tool | ClassMaster- Proposed as answer by Margriet Bruggeman Wednesday, January 25, 2012 9:20 AM
- Marked as answer by mortenbpost Wednesday, January 25, 2012 10:46 AM
Wednesday, January 25, 2012 3:00 AM
All replies
-
I think these 2 posts will be of help:
http://msdn.microsoft.com/en-us/library/ie/ee556780.aspx
http://msdn.microsoft.com/en-us/library/ie/ff798272.aspx
- Sid- Marked as answer by mortenbpost Wednesday, January 25, 2012 10:46 AM
Tuesday, January 24, 2012 11:04 PM -
The blog post below shows you how to call the SSS and use the credentials to call a web service.
http://sharepointfieldnotes.blogspot.com/2010/12/using-sharepoint-2010-secure-store.html
You can also use the Windows SDK Logon call to login as that particular user and execute a query to the database. Or if your database support SQL Authentication you can construct a connection string that uses the user name and password to connnect to the database.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa378184(v=vs.85).aspx
http://www.connectionstrings.com/sql-server-2008
Blog | SharePoint Field Notes Dev Tool | ClassMaster- Proposed as answer by Margriet Bruggeman Wednesday, January 25, 2012 9:20 AM
- Marked as answer by mortenbpost Wednesday, January 25, 2012 10:46 AM
Wednesday, January 25, 2012 3:00 AM -
Thanks all! I also found this article that i used: http://support.microsoft.com/kb/306158Wednesday, January 25, 2012 10:46 AM