1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef NSAUTHINFORMATIONHOLDER_H_
6 #define NSAUTHINFORMATIONHOLDER_H_
8 #include "nsIAuthInformation.h"
11 class nsAuthInformationHolder
: public nsIAuthInformation
{
13 virtual ~nsAuthInformationHolder() = default;
16 // aAuthType must be ASCII
17 nsAuthInformationHolder(uint32_t aFlags
, const nsString
& aRealm
,
18 const nsACString
& aAuthType
)
19 : mFlags(aFlags
), mRealm(aRealm
), mAuthType(aAuthType
) {}
22 NS_DECL_NSIAUTHINFORMATION
24 const nsString
& User() const { return mUser
; }
25 const nsString
& Password() const { return mPassword
; }
26 const nsString
& Domain() const { return mDomain
; }
29 * This method can be used to initialize the username when the
30 * ONLY_PASSWORD flag is set.
32 void SetUserInternal(const nsString
& aUsername
) { mUser
= aUsername
; }