mrbbot / ntlm

🔐 NTLM authentication for Dart/Flutter.
https://pub.dev/packages/ntlm
The Unlicense
14 stars 12 forks source link

enable different header prefixes #12

Closed robinmayerhofer closed 4 years ago

robinmayerhofer commented 4 years ago

Hi!

I made some changes to support NTLM as a fallback for WWW-Authenticate: Negotiate. As you can see in the Microsoft Docs on HTTP Authentication NTLM can be used as a fallback if the Kerberos protocol is unavailable. However, if the Kerberos protocol is unavailable, a server might expect and send messages using Negotiate <base64 encoded message>. (I found no documentation on whether the header prefix may change to NTLM, but in my use case it only works with Negotiate)

Therefore, I introduced a new variable headerPrefix in the NTLMClient and passed it to all helper functions for message 1-3. All new headerPrefix parameters for constructors/functions have their default value set to NTLM and are optional, to provide full backwards compatibility.

mrbbot commented 4 years ago

Great, thank you! Just tidied this up a bit and added some stuff to README.md in 93e5377. I'll publish a new version soon.

robinmayerhofer commented 4 years ago

Thanks for the fast response & merge!

mrbbot commented 4 years ago

Version 1.3.0 has now been published with this change.