none
Access sql server without directly permission in domain from ASP.NET RRS feed

  • Question

  • Hi all

    Here is the situation. All the machines and users are in the same domain.We are in a domain enviroment. There are some sql server 2005/2008 storing data. There is a ASP.NET site in the domain using the Window Authentication. Now, we need read the data from the sql server and display them using SqlDataSource and GridView. But most of users do not have the direct permission to access the database. Is there any solution to get the data from database and display them on the site without granting users permission?

    Best Regards,


    Welcome to my Blog http://jdxyw.blogspot.com
    Thursday, April 15, 2010 8:23 AM

Answers

All replies

  • They do not need to have direct permissions to access SQL Server. When ASP.NET application runs, it is hosted under specific system account, for example Network Services or ASPNET account, and you need to grant appropriate permissions to that hosting account.
    Val Mazur (MVP) http://www.xporttools.net
    Thursday, April 15, 2010 10:12 AM
    Moderator
  • Is the ASP.NET app/IIS and SQL Server running on the same machine? If so, then you should be able to enable impersonation for the ASP.NET app in order to allow the authenticated credentials to flow to SQL Server.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, April 15, 2010 6:54 PM
  • They do not need to have direct permissions to access SQL Server. When ASP.NET application runs, it is hosted under specific system account, for example Network Services or ASPNET account, and you need to grant appropriate permissions to that hosting account.
    Val Mazur (MVP) http://www.xporttools.net
    You are right. Actually I am on SharePoint. I make this web part for the users. It uses the current user's permission.
    Welcome to my Blog http://jdxyw.blogspot.com
    Friday, April 16, 2010 2:16 AM
  • Is the ASP.NET app/IIS and SQL Server running on the same machine? If so, then you should be able to enable impersonation for the ASP.NET app in order to allow the authenticated credentials to flow to SQL Server.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Actually,it's a SharePoint Farm. I can not enable impersonation, everybody should use their Window Authentication to access SharePoint. 
    Welcome to my Blog http://jdxyw.blogspot.com
    Friday, April 16, 2010 2:19 AM
  • You might want to post to a SharePoint forum. I'm not as familiar with the security context with respect to SharePoint and Web Parts, and it sounds like that is where the issue is:

    http://social.msdn.microsoft.com/forums/en-US/category/sharepoint/


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, April 16, 2010 12:00 PM