Skip to content

Commit dcfc6a0

Browse files
committed
Deprecate the "auth" parameter
1 parent b81a9a3 commit dcfc6a0

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,35 +368,33 @@ https://upcdn.io/W142hJk/image/example/city-landscape.jpg
368368
&color=ffe400
369369
```
370370

371-
## Authorization
371+
## Authentication
372372

373-
Bytescale supports two types of authorization:
373+
Bytescale supports two types of authentication:
374374

375375
### API Keys
376376

377377
The Bytescale Upload Widget uses the `apiKey` parameter to authenticate with [Bytescale](https://www.bytescale.com/).
378378

379379
With API key auth, the requester has access to the resources available to the API key:
380380

381-
- Secret API keys (`secret_***`) have access to all API endpoints ([Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript)).
381+
- Secret API keys (`secret_***`) have access to all API endpoints (see: [Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript)).
382382

383383
- Public API keys (`public_***`) have access to file upload, file download, and file listing API endpoints. File overwrites, file deletes, and all other destructive operations cannot be performed using public API keys. File listing is also disabled by default (but can be changed in the API key's settings).
384384

385385
You must always use **public API keys** (e.g. `public_***`) in your client-side code.
386386

387387
Each API key can have its read/write access limited to a subset of files/folders.
388388

389-
### JWT Cookies
389+
### JWTs
390390

391-
JWT cookies are optional.
391+
JWTs are optional.
392392

393-
With JWT cookies, the user can download private files directly via the URL, as authorization is performed implicitly via a session cookie. This allows the browser to display private files in `<img>` and `<video>` elements.
393+
With JWTs, the user can download private files directly via the URL, as authentication is performed implicitly via a session cookie _or_ via an `authorization` header if service workers are used (see the `serviceWorkerScript` param on the `AuthManager.beginAuthSession` method). This allows the browser to display private files in `<img>` and `<video>` elements.
394394

395-
With JWT cookies, the user can also upload files to locations that aren't otherwise permitted by the API key, but are permitted by the [JWT's payload](https://www.bytescale.com/docs/types/BytescaleJwt). This is because the [Bytescale Upload Widget](https://www.bytescale.com/docs/upload-widget) internally uses the [Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript) to perform file uploads, and the Bytescale JavaScript SDK automatically injects the user's JWT into all API requests once the `AuthManager.beginAuthSession` method has been called.
395+
With JWTs, the user can also perform API requests, such as file uploads, as these can be granted by the [JWT's payload](https://www.bytescale.com/docs/types/BytescaleJwt). This is because the [Bytescale Upload Widget](https://www.bytescale.com/docs/upload-widget) internally uses the [Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript) to perform file uploads, and the Bytescale JavaScript SDK automatically injects the user's JWT into all API requests once the `AuthManager.beginAuthSession` method has been called.
396396

397-
_Note: when using JWT cookies to download files, the `?auth=true` query parameter must be added to the URL._
398-
399-
[Learn more about the `AuthManager` and JWT cookies »](https://www.bytescale.com/docs/authorization#jwt-cookie)
397+
[Learn more about the `AuthManager` and JWTs »](https://www.bytescale.com/docs/auth)
400398

401399
## UrlBuilder
402400

0 commit comments

Comments
 (0)