You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Authentication.md
+98-47Lines changed: 98 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,81 +8,132 @@ This package requires the following environment variables to be set:
8
8
9
9
Below is a step-by-step of how to get the values to correctly fill those variables:
10
10
11
-
> Note: the names you enter below don't really matter, so you can just put whatever you feel comfortable with.
11
+
> Note: the names you enter below don't really matter, it's an app that only you will have access to so you can just put whatever you feel comfortable with.
12
+
> Google also likes to change these screens often, so things might not be 100% up to date (you can open a pull request, if thats the case :) )
> <imgwidth="187"alt="client type id"src="https://cloud.githubusercontent.com/assets/1402241/21517952/d1f36fce-cc97-11e6-92c0-de4485d97736.png">
37
+
1. On the next page, click "Back to Dashboard".
38
38
39
-
1. A new modal opens, with two fields, the first containing a `client ID`, and the second containing a `client secret`. Save those values, as we are going to need them later.
Note: If you just created a project, it might take a few minutes for "OAuth Client ID" to appear in the dropdown list. You'll need to refresh to page to see it appear.
50
+
51
+
1. On the next page, choose Application type "Desktop app" and add a name. Click "Create".
46
52
47
-
1. Follow the steps shown on the screen and, on the last page, you will see another code which is the `auth code`. Save this value, as we will also use it later. If you happen to see a screen saying something like `This app isn't verified`, just click on `Advanced`, and then `Go to <App name> (unsafe)`. It only says that because the app you just created is not verified by Google, but in our case, it doesn't make a difference.
53
+
> <imgwidth="400"alt="client type id"src="https://user-images.githubusercontent.com/630449/109427629-7c353980-79b0-11eb-9864-357baddd3efe.png">
1. A new modal opens, with two fields, the first containing a `Client ID`, and the second containing a `Client Secret`. **Save those values,** as we are going to need them later.
50
56
51
-
1. Run this in your browser's console.
52
-
It's just a wizard to create and copy a `curl` into your clipboard:
1. Paste the generated code in your terminal and run it. If your terminal doesn't natively support `curl`, try using the `git bash` terminal instead, or use [online curl](https://onlinecurl.com/). You can also [manually install curl](https://curl.haxx.se/dlwiz/), if none of options before worked.
70
+
1. Follow the steps shown on the screen. If you happen to see a screen saying something like `This app isn't verified`, just click on `Advanced`, and then `Go to <App name> (unsafe)`. It only says that because the app you just created is not verified by Google, but this was created on your account and will only be used by you, so you don't really need to worry about it.
71
+
72
+
1. You will reach this error page, with a URL that looks like:
73
73
74
-
1. The `curl` command will give you This will give you an object which looks like the following:
> <imgwidth="478"alt="A page that says 'This site can’t be reached'"src="https://user-images.githubusercontent.com/1402241/163123857-d2741237-80ea-482e-b468-ef9df75330f8.png">
77
79
78
-
From this object, the only important information is the `refresh_token`, so it is important to save this value as, you guessed it, we are going to need it later.
80
+
1. On the URL, copy the `approval code` which is between `code=` and `&scope`, it should look like this:
79
81
80
-
1. You should have now a `client ID`, a `client secret`, and a `refresh_token`. Use them to set the following environment values:
'The refresh_token has been copied into your clipboard. You’re done!',
121
+
)
122
+
} else {
123
+
console.log('Copy your token:')
124
+
console.log(json.refresh_token)
125
+
alert('Copy your refresh_token from the console output. You’re done!')
126
+
}
127
+
}
128
+
})()
129
+
```
130
+
131
+
1. You should have now a `Client ID`, a `Client Secret`, and a `Refresh Token`. Use them to set the following environment values:
132
+
133
+
-`GOOGLE_CLIENT_ID`: set the value to `Client ID`.
134
+
-`GOOGLE_CLIENT_SECRET`: set the value to `Client Secret`
135
+
-`GOOGLE_REFRESH_TOKEN`: set the value to `Refresh Token`
85
136
86
137
Now you should have all three environment variables correctly set. You can use the same values for all your extensions, but remember not share them publicly, as they will allow anyone to publish your extensions!
> This document was based on the [chrome-webstore-upload documentation](https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md). If there's something out of date, try checking their file, it might be more up-to-date.
0 commit comments