Hello Peter,
Thanks for posting in the group.
After reviewing the question, I feel you want to get the current credential
of VB.NET app programmaticall y and use it to access web service. Please
correct me if I have misunderstood the question.
Based on my experience, we could use CredentialCache .DefaultCredent ials to
get the system credentials for the current security context in which the
application is running. So you could try to use it in code to see if it
works under this situation.
Dim a As New server.Service1 ()
a.Credentials = CredentialCache .DefaultCredent ials;
MessageBox.Show (a.HelloWorld() ) // Call the web service
Does that answer your question?
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: "Peter Lapic" <pl****@shop-a-docket.com.au>
!Subject: NetworkCredenti al based on DefaultCredenti als
!Date: Mon, 20 Oct 2003 15:18:10 +1000
!Lines: 27
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <Ou************ **@TK2MSFTNGP12 .phx.gbl>
!Newsgroups: microsoft.publi c.dotnet.langua ges.vb
!NNTP-Posting-Host: 61.88.149.94
!Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:148303
!X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
!
!I am running an VB.Net app which calls an ASP.Net Web Service and this
!service accesses SQL Server.
!The Web Service & SQL Server run on separate Windows 2000 server on the
same
!domain.
!As we don't use Kerberos, the only means to flow the original user
!credentials from the VB.Net app right thru to SQL Server is to set the web
!service object credentials parameter in the VB.Net app.
!
!The credentials is created based on the following code
!oCredentials.A dd(New Uri(oRollOrderA utomation.Url), "Basic", New
!System.Net.Net workCredential( InputBox("Enter Windows Login Name: ",
!"Username", "my login"), InputBox("Enter Windows Password: ", "Password",
!"my password"), "my domain"))
!
!Without prompting the user to rekey their windows username & password is
!there some way to pass the current windows network connection to the
!credentials object?
!
!Regards
!
!Peter
!
!
!
!
!
!
!