Re: Authorization HTML Header going missing
From: Shaun Wilde (shaun_wilde_at_nospam.co.uk)
Date: 11/30/04
- Next message: Gina L. Hernandez: "calling an aspx page"
- Previous message: John Hoge: "Re: Bind multiple selections to a query"
- Maybe in reply to: Shaun Wilde: "Re: Authorization HTML Header going missing"
- Next in thread: Steven Cheng[MSFT]: "Re: Authorization HTML Header going missing"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Nov 2004 22:12:34 -0000
Hi Steven
Sorry this skipped being read as my newsreader settings didn't read all
headers (fixed now)
I manually set it because the preauthentication flag doesn't work for
webservice - this is a known bug.
I also do not want to turn on basic authentication to make it work as I need
to handle the basic authentication using my own httphandler to check the
credentials.
(I also do not have the correct permission on the domain involved to add my
own users and thus I cannot use IIS basic authentication - unless you know
of another way of supplying username/password combinations)
Try turning off the basic authentication and looking for the authorization
field within the application (ps you will need to use my code to get
preauthentication to work) - see my original example.
Shaun
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:nsBFlzc0EHA.2544@cpmsftngxa10.phx.gbl...
> Hi Shaun,
>
> Thanks for your response. Yes, I've just tested on a w2k server(iis5) with
> framework1.1 ,but the behavior is the same as I tested on other
enviorment,
> the Authorization header is sent correctly.
> Have you tried changing to use another custom Header Name such as
>
> webReq.Headers.Add("myheaderitem", "myheadervalue")
>
> to see whether it can be sent correctly?
>
> In addition, I'm a bit confused that why you need to manually set the
HTTP
> authorization header? When we add the following code
>
> Dim cache As New System.Net.CredentialCache
> Dim cred As New System.Net.NetworkCredential("IWTeamMember1",
> "Password01!", "sha-dng-chn")
> cache.Add(New
> Uri(System.Configuration.ConfigurationSettings.AppSettings("Uri")),
> "Basic", cred)
> ws.Credentials = cache
>
> the webrequest will automatically add the HTTP authorization header for
us.
> That means, even we don't override the GetWebRequest and manually add
the
> header, the webrequest will generate the header for use according to the
> NewworkCrediential we add in the CredentialCache. I've tested this to
> confirm this behavior. Have you also tried this?
>
> Just turn on the IIS's BASIC authentication and run the following code at
> client
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Try
> Dim service As New AuthTestService.AuthTestService
>
> Dim cache As New System.Net.CredentialCache
> Dim cred As New System.Net.NetworkCredential("username",
> "password!", "servername")
> cache.Add(New
> Uri(System.Configuration.ConfigurationSettings.AppSettings("Uri")),
> "Basic", cred)
> service.Credentials = cache
>
> MessageBox.Show(service.HelloWorld())
>
>
> Catch ex As Exception
>
> MessageBox.Show(ex.ToString())
> End Try
>
> this can return "HelloWorld" correctly.
>
> Please have a check and let me know if there is anything unclear. Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
> End Sub
>
>
- Next message: Gina L. Hernandez: "calling an aspx page"
- Previous message: John Hoge: "Re: Bind multiple selections to a query"
- Maybe in reply to: Shaun Wilde: "Re: Authorization HTML Header going missing"
- Next in thread: Steven Cheng[MSFT]: "Re: Authorization HTML Header going missing"
- Messages sorted by: [ date ] [ thread ]