[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Can't Specify Explicit Credentials (Default One Works)

(lukeo)

6/7/2004 7:46:00 PM

I'm developing a secure web service on a XP machine using integrated
security. I can access the service when I use

m_rs.Credentials = System.Net.CredentialCache.DefaultCredentials

But when I specify any other settings (even Administrator) nothing
gives. I still get 401 errors.

Dim testUserCred As New System.Net.NetworkCredential(username,
userpassword, domain)

Dim cache As CredentialCache = New CredentialCache
cache.Add(New Uri(m_rs.Url), "Negotiate", CType(testUserCred,
NetworkCredential))
m_rs.Credentials = cache


I know my URL is correct and the "Negotiate" setting is correct
because if I do this:

Dim cache As CredentialCache = New CredentialCache
cache.Add(New Uri(m_rs.Url), "Negotiate",
CType(CredentialCache.DefaultCredentials, NetworkCredential))
m_rs.Credentials = cache

Then it works.



2 Answers

Jan Tielens

6/7/2004 9:37:00 PM

0

Did you try to set the PreAuthenticate flag to true?

--
Greetz
Jan
________________
Read my weblog: http://weblogs.a...


"lukeo" <lukeo@teleport.com> schreef in bericht
news:78a9c0psukar3a4augo47fcluqfrr694d9@4ax.com...
> I'm developing a secure web service on a XP machine using integrated
> security. I can access the service when I use
>
> m_rs.Credentials = System.Net.CredentialCache.DefaultCredentials
>
> But when I specify any other settings (even Administrator) nothing
> gives. I still get 401 errors.
>
> Dim testUserCred As New System.Net.NetworkCredential(username,
> userpassword, domain)
>
> Dim cache As CredentialCache = New CredentialCache
> cache.Add(New Uri(m_rs.Url), "Negotiate", CType(testUserCred,
> NetworkCredential))
> m_rs.Credentials = cache
>
>
> I know my URL is correct and the "Negotiate" setting is correct
> because if I do this:
>
> Dim cache As CredentialCache = New CredentialCache
> cache.Add(New Uri(m_rs.Url), "Negotiate",
> CType(CredentialCache.DefaultCredentials, NetworkCredential))
> m_rs.Credentials = cache
>
> Then it works.
>
>
>


(lukeo)

6/7/2004 9:56:00 PM

0

I didn't think I could preauthenticate using NTLM (integrated
security) but I tried it anyway with no difference.

-Luke

On Mon, 7 Jun 2004 21:37:55 +0200, "Jan Tielens"
<jan@no.spam.please.leadit.be> wrote:

>Did you try to set the PreAuthenticate flag to true?