aboutsummaryrefslogtreecommitdiffstats
path: root/docs/passwords.md
blob: 283c54b980f90c5514facf908d2098afecf7251e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
The `passwords` module provides access to the Firefox Password Manager.

<api name="setPassword">
@method
The `setPassword` method sets new authentication pair to the encrypted
Firefox's nsILoginManager.

It is most useful for storing sensitive data with private information
to the store. It is most useful in situation where script would need
some personal information, but it is our responsibility to store it
securely.

@param username {string} login name
@param pass {string} password
@param domain {string} hostname of the server we are connecting to as URL.
As for example "http://bugzilla.mozilla.org" 
@param realm {string} String distinguishing this login to other ones for
the same hostname.

@returns {string}
</api>

<api name="getPassword">
@method
The `getPassword` method returns the password specified by the
parameters of this function. 

@param username {string} login name
@param domain {string} the same as in `setPassword` method.
@param realm {string} the same as in `setPassword` method.

@returns {string}
</api>

<api name="removePassword">
@method
The `removePassword` method remove the login information from the storage.
Note that the serach parameters of this function must much **EXACTLY**
parameters of the corresponding call to `setPassword`.

@param username {string} login name
@param domain {string} the same as in `setPassword` method.
@param realm {string} the same as in `setPassword` method.

@returns {string}
</api>

Examples
--------

For examples see `tests/test-password.js`