NTLM Authorization

357 views
Skip to first unread message

Omar Tayel

unread,
Aug 11, 2011, 10:06:58 PM8/11/11
to RestSharp
I would like to know how to add an NTLM Authorization header to a Post
Requset??

Andrew Young

unread,
Aug 11, 2011, 10:09:31 PM8/11/11
to rest...@googlegroups.com
Does this help you?


Let me know if you need something more specific.

Omar Tayel

unread,
Aug 12, 2011, 7:23:51 AM8/12/11
to RestSharp
This still didn't tell me how to add "NTLM" Authorization header.
The problem i am currently facing is :

I use normal httpwebrequest to send a request, I add credentials (my
email and password), then i watch the request using fiddler, the
negotiate authorization header is very veryyyy large. I am move on to
using restsharp , i use basichttpauthorization and the resulting
header is veryyyy smalllllllll, so i receive an unauthorized error.

So i need to know how to send a negotiate or NTLM header using
restsharp. Or if you know how to generate this header (encoding and
what to put in it) and i know already know how to add the header using
addparameter function.

Thanks for you help in advance :) .

Andrew Young

unread,
Aug 12, 2011, 1:40:45 PM8/12/11
to rest...@googlegroups.com
It sounds like you're trying to use credentials that aren't the currently logged in user.

Take a look at the implementation of the NtlmAuthenticator.cs. It uses System.Net.CredentialCache.DefaultCredentials and does not allow for a custom credential. To support this a separate constructor overload would need to be added to the NtlmAuthenticator to take in a user and password and construct a new NetworkCredential.

NTLM is encrypted which is why the values are so large. Basic auth is sent in plain text.

Andrew Young

unread,
Aug 12, 2011, 2:21:46 PM8/12/11
to rest...@googlegroups.com
Sorry, basic isn't in plain text. Its encoded but still isn't as large as an encrypted value.

Omar Tayel

unread,
Aug 12, 2011, 8:12:03 PM8/12/11
to RestSharp
so does anyone know how i can encrypt the data ??

Andrew Young

unread,
Aug 13, 2011, 2:17:49 AM8/13/11
to rest...@googlegroups.com
I'm sorry. I'm not following. Can you be more specific with what you're trying to do?
Reply all
Reply to author
Forward
0 new messages