mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-04-28 20:05:23 +08:00
Document auth:import (#128)
This commit is contained in:
committed by
Michael Bleigh
parent
fac42de577
commit
dd41cee63b
75
README.md
75
README.md
@@ -72,6 +72,81 @@ Command | Description
|
||||
------- | -----------
|
||||
**hosting:disable** | Stop serving Firebase Hosting traffic for the active project. A "Site Not Found" message will be displayed at your project's Hosting URL after running this command.
|
||||
|
||||
### Auth Commands
|
||||
|
||||
Command | Description
|
||||
------- | -----------
|
||||
**auth:import** | Batch importing accounts into Firebase.
|
||||
|
||||
The supported file format are [csv](#auth_csv_format) and [json](#auth_json_format).
|
||||
|
||||
#### <a name="auth_csv_format"></a>CSV format
|
||||
Every line represents an user account. There must be at least 23 columns each line. The definition of each column is as followed. `UID` is required. If there's no value in other field, just leave that position empty. Quotation marks can also be added for all string fields.
|
||||
|
||||
Pos. | Name | Type
|
||||
-------- | ---- | ----
|
||||
1 | UID | String
|
||||
2 | Email | String
|
||||
3 | Email Verified | Boolean
|
||||
4 | Password Hash | String
|
||||
5 | Password Salt | String
|
||||
6 | Display Name | String
|
||||
7 | Photo URL | String
|
||||
8 | Google:ID | String
|
||||
9 | Google:Email | String
|
||||
10 | Google:Display Name | String
|
||||
11 | Google:Photo URL | String
|
||||
12 | Facebook:ID | String
|
||||
13 | Facebook:Email | String
|
||||
14 | Facebook:Display Name | String
|
||||
15 | Facebook:Photo URL | String
|
||||
16 | Twitter:ID | String
|
||||
17 | Twitter:Email | String
|
||||
18 | Twitter:Display Name | String
|
||||
19 | Twitter:Photo URL | String
|
||||
20 | Github:Id | String
|
||||
21 | Github:Email | String
|
||||
22 | Github:Display Name | String
|
||||
23 | Github:Photo URL | String
|
||||
|
||||
**<a name="example_account"></a>Example:**
|
||||
|
||||
```
|
||||
111, test@test.org, false, XXXX, YYYY, Test User, http://photo.com/123, , , , , 123, test@test.org, Test FB User, http://photo.com/456, , , , , , , , ,
|
||||
```
|
||||
Note: Spaces between commas can be eliminated automatically.
|
||||
|
||||
#### <a name="auth_json_format"></a>JSON format
|
||||
The JSON file should looks like this:
|
||||
```js
|
||||
{
|
||||
“users”: [
|
||||
{
|
||||
"localId": "111",
|
||||
"email": "test@test.org"
|
||||
"emailVerified": false,
|
||||
"passwordHash": "XXXX",
|
||||
"salt": "YYYY",
|
||||
"displayName": "Test User",
|
||||
"photoUrl": "http://photo.com/123",
|
||||
"providerUserInfo": [ {
|
||||
"providerId": “facebook.com”
|
||||
"rawId": “123”,
|
||||
"email": "test@test.org",
|
||||
"displayName": "Test FB User",
|
||||
"photoUrl": "http://photo.com/456"
|
||||
} ]
|
||||
}, {
|
||||
...
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
The first element of `users` in above JSON object represents the [example user account](#example_account) in previous section. All user accounts should be put in `users`. `localId` is actually `UID` and is required. `providerId` must be one of "google.com", "facebook.com", "github.com", and "twitter.com".
|
||||
|
||||
## Using with CI Systems
|
||||
|
||||
The Firebase CLI requires a browser to complete authentication, but is fully
|
||||
|
||||
Reference in New Issue
Block a user