Up:: OData (Open Data Protocol)
Basic Authentication with OData
- Author:: Microsoft
- Category:: website
- URL:: OData and Authentication – Part 6 – Custom Basic Authentication - OData (microsoft.com)
- Rating:: how effective this resource is at solving your problem or teaching you something
Learn by elaboration
Using the request headers directly
Another option is to just create and send the authentication header yourself.
- Hook up to the DataServiceContext’s SendingRequest Event:
- Add the Basic Authentication Header to the request:
As you can see this is pretty simple. And has the advantage that it will work even if the server doesn’t respond with a challenge (i.e. WWW-Authenticate header).