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 programmatically and use it to access web service. Please
correct me if I have misunderstood the question.
Based on my experience, we could use CredentialCache.DefaultCredentials 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.DefaultCredentials;
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: NetworkCredential based on DefaultCredentials
!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.public.dotnet.languages.vb
!NNTP-Posting-Host: 61.88.149.94
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:148303
!X-Tomcat-NG: microsoft.public.dotnet.languages.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.Add(New Uri(oRollOrderAutomation.Url), "Basic", New
!System.Net.NetworkCredential(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
!
!
!
!
!
!
!