1 /* vim:set ts=4 sw=4 et cindent: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsAuthSambaNTLM_h__
7 #define nsAuthSambaNTLM_h__
9 #include "nsIAuthModule.h"
14 #include "mozilla/Attributes.h"
17 * This is an implementation of NTLM authentication that does single-signon
18 * by obtaining the user's Unix username, parsing it into DOMAIN\name format,
19 * and then asking Samba's ntlm_auth tool to do the authentication for us
20 * using the user's password cached in winbindd, if available. If the
21 * password is not available then this component fails to instantiate so
22 * nsHttpNTLMAuth will fall back to a different NTLM implementation.
23 * NOTE: at time of writing, this requires patches to be added to the stock
24 * Samba winbindd and ntlm_auth!
26 class nsAuthSambaNTLM final
: public nsIAuthModule
34 // We spawn the ntlm_auth helper from the module constructor, because
35 // that lets us fail to instantiate the module if ntlm_auth isn't
36 // available, triggering fallback to the built-in NTLM support (which
37 // doesn't support single signon, of course)
38 nsresult
SpawnNTLMAuthHelper();
45 uint8_t* mInitialMessage
; /* free with free() */
46 uint32_t mInitialMessageLen
;
48 PRFileDesc
* mFromChildFD
;
49 PRFileDesc
* mToChildFD
;
52 #endif /* nsAuthSambaNTLM_h__ */