Pass on authenticated username and password of SharePoint Site in NetworkCredential() method.

Last post 01-31-2007 8:56 PM by Leijun Jie - MSFT. 1 replies.

Sort Posts:

  • Pass on authenticated username and password of SharePoint Site in NetworkCredential() method.

    01-25-2007, 1:53 AM
    • Member
      57 point Member
    • rmpasha
    • Member since 08-14-2006, 9:39 AM
    • Kathmandu, Nepal
    • Posts 26

    I am using WebServices methods of SharePoint Server/Project Server. As we know that the user name and password are needed to access the sharpoint site/project server site(PWA). While I used the following code(C#) in my ascx page, it works fine.

    private static UserGroupWS.UserGroup userGroup = new UserGroupWS.UserGroup(); 

    userGroup.Url = "http://DomainName/_vti_bin/UserGroup.asmx"; 

    userGroup.Credentials = new System.Net.NetworkCredential("UserName", "Password", "DomainName");

    Note that there are the parameters namded "Password" also in NetworkCredential() method. While this page is using as webpart in SharePoint Site, I can access the UserName currently logined to pass as first parameter in this method. But how to retrieve Password of the current UserName currently logined to pass as second parameter in this method? Is there any idea?

    Please help!!! 


     

  • Re: Pass on authenticated username and password of SharePoint Site in NetworkCredential() method.

    01-31-2007, 8:56 PM
    Answer
    Hi rmpasha, this is a duplicate thread, let's discuss in the other one:
    http://forums.asp.net/1547986/ShowPost.aspx
    The future is now...
    Sincerely,
    LeiJun Jie
    Microsoft Online Community Support
Page 1 of 1 (2 items)