Passing Credentials to a Web Service

Discussion in 'ASP .Net Web Services' started by Ramjee Tangutur, Feb 19, 2004.

  1. Hi Al
    We have a web service (developed in C#). This web service is hosted in the Partners domain of Microsoft. A Windows Forms application is the consumer of this web service. The client can call the web service in two scenarios that is the client can be a part of the Corporate Intranet or the client can be in some remote location and access the web service over RAS.

    We pass the credentials to the Web Service call as belowâ€

    1. WebServiceObject.Credentials = Credentials.DefaultCredentials(); --> This will be used if the client is in Intrane

    2. WebServiceObject.Credentials = new NetworkCredentials(“UserIDâ€,â€Passwordâ€,â€Domainâ€); --> This will be used if the client is in extranet

    Our Application has proper logic to determine if the client app is in Intranet or in Extranet

    Now the problem that we face is, the credentials are not getting passed if we use the statement 2. We looked at the IIS Log from (C:\Windows\System32\LogFiles\...). Here from the log we saw that NULL credentials are getting passed.

    The following is the IIS configuration which hosts the Web Service

    1. OS --> Windows Server 200
    2. IIS Ver --> 6.
    3. Uses Application Pool
    4. App Pool Identity --> “Local Systemâ€
    5. Authentication on the Vir Dir --> “Integrated Windows†and “Digestâ€

    Any pointers on what could be going wrong will be of great help. Please let us know, if we are missing some extra settings

    *** Please mark a cc of the reply to and ***

    Thanks & Regards
    Ramjee Tangutu
    Microsoft India Community Star (.NET
     
    Ramjee Tangutur, Feb 19, 2004
    #1
    1. Advertising

  2. Ramjee Tangutur

    Jan Tielens Guest

    Do you use following line too?

    WebServiceObject.PreAuthenticate = true;

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan


    "Ramjee Tangutur" <> wrote in message
    news:...
    > Hi All
    > We have a web service (developed in C#). This web service is hosted in the

    Partners domain of Microsoft. A Windows Forms application is the consumer of
    this web service. The client can call the web service in two scenarios that
    is the client can be a part of the Corporate Intranet or the client can be
    in some remote location and access the web service over RAS.
    >
    > We pass the credentials to the Web Service call as below.
    >
    > 1. WebServiceObject.Credentials = Credentials.DefaultCredentials(); -->

    This will be used if the client is in Intranet
    >
    > 2. WebServiceObject.Credentials = new NetworkCredentials("UserID","

    Password","Domain"); --> This will be used if the client is in extranet.
    >
    > Our Application has proper logic to determine if the client app is in

    Intranet or in Extranet.
    >
    > Now the problem that we face is, the credentials are not getting passed if

    we use the statement 2. We looked at the IIS Log from
    (C:\Windows\System32\LogFiles\...). Here from the log we saw that NULL
    credentials are getting passed.
    >
    > The following is the IIS configuration which hosts the Web Service.
    >
    > 1. OS --> Windows Server 2003
    > 2. IIS Ver --> 6.0
    > 3. Uses Application Pools
    > 4. App Pool Identity --> "Local System"
    > 5. Authentication on the Vir Dir --> "Integrated Windows" and "Digest"
    >
    > Any pointers on what could be going wrong will be of great help. Please

    let us know, if we are missing some extra settings.
    >
    > *** Please mark a cc of the reply to and

    ***
    >
    >
    > Thanks & Regards,
    > Ramjee Tangutur
    > Microsoft India Community Star (.NET)
    >
    >
     
    Jan Tielens, Feb 20, 2004
    #2
    1. Advertising

  3. Ramjee Tangutur

    Alek Davis Guest

    Ramjee,

    Not sure if this will help but try enabling basic authentication (you will
    need to use it with SSL to prevent exposure of credentials). By the way, how
    do you distinguish between intranet and extranet users (if this is not a
    secret)? Thanks.

    Alek

    "Ramjee Tangutur" <> wrote in message
    news:...
    > Hi All
    > We have a web service (developed in C#). This web service is hosted in the

    Partners domain of Microsoft. A Windows Forms application is the consumer of
    this web service. The client can call the web service in two scenarios that
    is the client can be a part of the Corporate Intranet or the client can be
    in some remote location and access the web service over RAS.
    >
    > We pass the credentials to the Web Service call as below:
    >
    > 1. WebServiceObject.Credentials = Credentials.DefaultCredentials(); -->

    This will be used if the client is in Intranet
    >
    > 2. WebServiceObject.Credentials = new NetworkCredentials("UserID","

    Password","Domain"); --> This will be used if the client is in extranet.
    >
    > Our Application has proper logic to determine if the client app is in

    Intranet or in Extranet.
    >
    > Now the problem that we face is, the credentials are not getting passed if

    we use the statement 2. We looked at the IIS Log from
    (C:\Windows\System32\LogFiles\...). Here from the log we saw that NULL
    credentials are getting passed.
    >
    > The following is the IIS configuration which hosts the Web Service.
    >
    > 1. OS --> Windows Server 2003
    > 2. IIS Ver --> 6.0
    > 3. Uses Application Pools
    > 4. App Pool Identity --> "Local System"
    > 5. Authentication on the Vir Dir --> "Integrated Windows" and "Digest"
    >
    > Any pointers on what could be going wrong will be of great help. Please

    let us know, if we are missing some extra settings.
    >
    > *** Please mark a cc of the reply to and

    ***
    >
    >
    > Thanks & Regards,
    > Ramjee Tangutur
    > Microsoft India Community Star (.NET)
    >
    >
     
    Alek Davis, Mar 1, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    8,275
    Clint ()
    Dec 21, 2004
  2. Web Team @ Borough of Poole

    Credentials for web service

    Web Team @ Borough of Poole, May 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    437
    Web Team @ Borough of Poole
    May 9, 2005
  3. Web Team @ Borough of Poole

    Web Service Credentials

    Web Team @ Borough of Poole, May 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    9,732
    Web Team @ Borough of Poole
    May 10, 2005
  4. Morten Wennevik

    Asynchronous web service credentials.

    Morten Wennevik, Sep 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    462
    Morten Wennevik
    Sep 7, 2006
  5. Mark D.
    Replies:
    0
    Views:
    245
    Mark D.
    Aug 11, 2004
Loading...

Share This Page