locked
How can we use Sharepoint Accounts and groups in Asp.net web application? RRS feed

  • Question

  • Hi Friends,

              I have created one web applicaiton in dotnet 2005 .Its working fine ,i have used froms based authentication.Now i want to deploy the same application in sps 2003 ,wss2.0 .I have created pageviewer web part and integrated the application in sharepoint.I have created one account group for specific users who can be accessble to that group only.I want to use the group users and group of sharepoint in the asp.net web application in place of form authentication .How can we use the Sharepoint users and accounts in web application .I want to check users and their group in web application.
    Please give me suggestion help me out for the requirement

    Regards
    Ravishanker Maduri
    Ravishankar Maduri MCTS,MCPD,MCP
    Wednesday, June 24, 2009 6:59 AM

Answers

  • Hey Ravishanker,

    I see three potential answers here:
     
    Answer 1: You can't use sharepoint users and groups outside of a sharepoint app. 
    Answer 2: Well, maybe you can, if you make it Windows-auth, with impersonation, and create a new SharePoint context by creating SPSite/
    SPWeb instances with the calling user's identity, where you can check roles and permissions.
    Answer 3: I recommend you rewrite the app to run inside of the sharpeoint context. You could deploy it in _layouts as an "easy option". 

    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
    Wednesday, June 24, 2009 6:32 PM

All replies

  • Hi Ravishankar,

    What do you mean dotnet 2005? It is .NET 2.0? I might be wrong, but as I remember SPS 2003 is not really supported with .NET 2.0 (although WSS 2.0 is supported). If I'm wrong, please update me!
    SharePoint Portal Server 2003 must use ASP.NET 1.1
    http://support.microsoft.com/default.aspx/kb/907763

    It means you cannot deploy your application to the same web application as SPS 2003. But you wrote about PageViewer webpart, so the integration seems to be only a visual one, where your application is in a dedicated web application, but is shown in an IFRAME on the SPS user interface.

    Maybe I don't understand all the details of your question, but if you use SPS 2003, then it runs with Windows authentication, your SharePoint accounts are mappings of Active Directory accounts. Then if you would like to use this account in your web application, why don't you use the integrated Windows authentication instead of forms-based authentication?

    Where are your users and groups stored now for the forms-based authentication? I assume in SQL database.

    If you would like to store the accounts and groups for the forms-based authentication at other place, then you have to get or create (code) the ASP.NET 2.0 membership and role providers for that.

    "I have created one account group for specific users who can be accessble to that group only." What does it mean? It sounds to me like a catch 22.

    Peter
    Wednesday, June 24, 2009 8:18 AM
  • Hi ,

          Dotnet 2005 ,i mean its .NET 2.0 only.I am using iframe using pageviewer and the details of the users are in sql server ,i am using form based authentication in the web application of dotnet 2.0.I have created one group in sharepoint portal and added some users for specific permissions and some users as of admin rights ,now i want to use those user accounts and groups in my dotnet 2.0 web application ,how can access the details of the user when logged in to the sharepoint in dotnet 2.0 web application, so that i can check he is authorized for specific form or not instead of using forms authentication .

    Regards
    Ravishanker Maduri
    Ravishankar Maduri MCTS,MCPD,MCP
    Wednesday, June 24, 2009 4:36 PM
  • Hey Ravishanker,

    I see three potential answers here:
     
    Answer 1: You can't use sharepoint users and groups outside of a sharepoint app. 
    Answer 2: Well, maybe you can, if you make it Windows-auth, with impersonation, and create a new SharePoint context by creating SPSite/
    SPWeb instances with the calling user's identity, where you can check roles and permissions.
    Answer 3: I recommend you rewrite the app to run inside of the sharpeoint context. You could deploy it in _layouts as an "easy option". 

    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
    Wednesday, June 24, 2009 6:32 PM
  • Hi Rajesh,

              My Requirement is ,i want to deploy the vb.net 1.1 application in sharepoint ,i,e sps 2003 by using page viewer web part.In that i have to give access to specific windows accounts only .I thought if we create some group then we can check the user credential i mean windows loggged in user if it is there in the current group access list then we can give him access to see the (web Page vb.net 2003 in sharepoint pageviewer web part).

    I am able to run the application in side the sharepoint .Now i have to go for authentication by using specific users access to that web application in sharepoint .


    Ravishankar Maduri MCTS,MCPD,MCP
    Monday, August 10, 2009 10:35 PM