Skip to content

Commit

Permalink
docs(README): better disclamer for browser users
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Mar 24, 2021
1 parent d64bc69 commit f8194dd
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@
Browsers
</th><td width=100%>

Load `@octokit/auth-app` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
⚠️ `@octokit/auth-app` is not meant for usage in the browser. A private key and client secret must not be exposed to users.

```html
<script type="module">
import { createAppAuth } from "https://cdn.skypack.dev/@octokit/auth-app";
</script>
```

⚠️ The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:
The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:

```shell
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
```

Also creating and refreshing OAuth user-to-server tokens is not possible due to CORS restrictions.
If you know what you are doing, load `@octokit/auth-app` directly from [cdn.skypack.dev](https://cdn.skypack.dev)

```html
<script type="module">
import { createAppAuth } from "https://cdn.skypack.dev/@octokit/auth-app";
</script>
```

</td></tr>
<tr><th>
Expand Down Expand Up @@ -193,7 +193,15 @@ Browsers

</th><td width=100%>

Load `@octokit/auth-app` and `@octokit/core` (or a compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
⚠️ `@octokit/auth-app` is not meant for usage in the browser. A private key and client secret must not be exposed to users.

The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:

```shell
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
```

If you know what you are doing, load `@octokit/auth-app` and `@octokit/core` (or a compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)

```html
<script type="module">
Expand All @@ -202,14 +210,6 @@ Load `@octokit/auth-app` and `@octokit/core` (or a compatible module) directly f
</script>
```

⚠️ The private keys provided by GitHub are in `PKCS#1` format, but the WebCrypto API only supports `PKCS#8`. You need to convert it first:

```shell
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key
```

Also creating and refreshing OAuth user-to-server tokens is not possible due to CORS restrictions.

</td></tr>
<tr><th>

Expand Down

0 comments on commit f8194dd

Please sign in to comment.