Skip to content

Commit 96aec34

Browse files
authored
Merge pull request #1375 from strapi/main
Production release: Strapi docs v4.5.5
2 parents 2477718 + dc3f72a commit 96aec34

File tree

29 files changed

+241
-78
lines changed

29 files changed

+241
-78
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
The installation requires the following software to be already installed on your computer:
1+
Before installing Strapi, the following requirements must be installed on your computer:
22

3-
- [Node.js](https://nodejs.org): only maintenance and LTS versions are supported (v14, v16, and v18). Other versions of Node.js may not be compatible with the latest release of Strapi. Node v18.x is recommended for Strapi v4.3.9 and above, Node v16.x for Strapi v4.0.x to v4.3.8.
4-
- [npm](https://docs.npmjs.com/cli/v6/commands/npm-install) (v6 only) or [yarn](https://yarnpkg.com/getting-started/install) to run the CLI installation scripts.
5-
- [Python](https://www.python.org/downloads/) when using a SQLite database
3+
- [Node.js](https://nodejs.org): Only Maintenance and LTS versions are supported (`v14`, `v16`, and `v18`).
4+
- Node v18.x is recommended for Strapi `v4.3.9` and above
5+
- Node v16.x is recommended for Strapi `v4.0.x` to `v4.3.8`.
6+
- Your preferred Node.js package manager:
7+
- [npm](https://docs.npmjs.com/cli/v6/commands/npm-install) (`v6` only)
8+
- [yarn](https://yarnpkg.com/getting-started/install)
9+
- [Python](https://www.python.org/downloads/) (if using a SQLite database)

docs/developer-docs/latest/development/backend-customization/models.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ The `info` key in the model's schema describes information used to display the m
102102
| `displayName` | String | Default name to use in the admin panel |
103103
| `singularName` | String | Singular form of the content-type name.<br>Used to generate the API routes and databases/tables collection.<br><br>Should be kebab-case. |
104104
| `pluralName` | String | Plural form of the content-type name.<br>Used to generate the API routes and databases/tables collection.<br><br>Should be kebab-case. |
105-
| `description` | String | Description of the model |
106-
| `icon`<br><br>_Optional,_<br>_only for Components_ | String | [FontAwesome](https://fontawesome.com/) (v5) icon name to use for the component's icon in the admin panel
105+
| `description` | String | Description of the model
107106

108107
```json
109108
// ./src/api/[api-name]/content-types/restaurant/schema.json

docs/developer-docs/latest/plugins/graphql.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,3 +891,19 @@ mutation {
891891
:::
892892

893893
Then on each request, send along an `Authorization` header in the form of `{ "Authorization": "Bearer YOUR_JWT_GOES_HERE" }`. This can be set in the HTTP Headers section of your GraphQL Playground.
894+
895+
## API tokens
896+
897+
To use API tokens for authentication, pass the token in the `Authorization` header using the format `Bearer your-api-token`.
898+
899+
:::note
900+
Using API tokens in the the GraphQL playground requires adding the authorization header with your token in the `HTTP HEADERS` tab:
901+
902+
```http
903+
{
904+
"Authorization" : "Bearer <TOKEN>"
905+
}
906+
```
907+
908+
Replace `<TOKEN>` with your API token generated in the Strapi Admin panel.
909+
:::

docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Using API tokens allows executing a request on Strapi's REST API en
77

88
Authentication strategies in Strapi can either be based on the use of the [Users & Permissions plugin](/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.md) or on the built-in API token feature.
99

10-
Using API tokens allows executing a request on [REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md) endpoints as an authenticated user.
10+
Using API tokens allows executing a request on [REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md) or [GraphQL API](/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md) endpoints as an authenticated user.
1111

1212
## Creation
1313

docs/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Strapi provides the following environment variables:
1818
| `STRAPI_HIDE_STARTUP_MESSAGE` | Don't show the startup message in the terminal | `Boolean` | `false` |
1919
| `STRAPI_TELEMETRY_DISABLED` | Don't send telemetry usage data to Strapi | `Boolean` | `false` |
2020
| `STRAPI_LICENSE` | The license key to activate the Enterprise Edition | `String` | `undefined` |
21-
| `NODE_ENV` | Type of environment where the application is running.<br/><br/>`production` enables specific behaviors (see [Node.js documentation](https://nodejs.dev/learn/nodejs-the-difference-between-development-and-production) for details) | `String` | `'development'` |
21+
| `NODE_ENV` | Type of environment where the application is running.<br/><br/>`production` enables specific behaviors (see [Node.js documentation](https://nodejs.dev/en/learn/nodejs-the-difference-between-development-and-production) for details) | `String` | `'development'` |
2222
| `BROWSER` | Open the admin panel in the browser after startup | `Boolean` | `true` |
2323
| `ENV_PATH` | Path to the file that contains your environment variables | `String` | `'./.env'` |
2424
| `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` <br/><br/>_Optional_ | Initialization locale for the application, if the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.md) is installed and enabled on Content-Types (see [Configuration of i18n in production environments](/developer-docs/latest/plugins/i18n.md#configuration-of-the-default-locale)) | `String` | `'en'` |

docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md

Lines changed: 93 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Strapi's SSO allows you to configure additional sign-in and sign-up
44
sidebarDepth: 3
55
canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.html
66
---
7+
<!-- markdownlint-disable-file MD033 MD025 MD036 -->
78

89
# Single Sign-On <GoldBadge link="https://strapi.io/pricing-self-hosted/" withLinkIcon />
910

@@ -43,7 +44,6 @@ module.exports = ({ env }) => ({
4344
});
4445
```
4546

46-
4747
</code-block>
4848

4949
<code-block title="TYPESCRIPT">
@@ -62,8 +62,6 @@ export default ({ env }) => ({
6262
</code-block>
6363
</code-group>
6464

65-
66-
6765
## Setting up provider configuration
6866

6967
A provider's configuration is a JavaScript object built with the following properties:
@@ -83,6 +81,93 @@ The `uid` property is the unique identifier of each strategy and is generally fo
8381
By default, Strapi security policy does not allow loading images from external URLs, so provider logos will not show up on the [login screen](/user-docs/latest/getting-started/introduction.md#accessing-the-admin-panel) of the admin panel unless [a security exception is added](/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md#security).
8482
:::
8583

84+
::: details Example: Security exception for provider logos
85+
<br/>
86+
87+
<code-group>
88+
<code-block title="JAVASCRIPT">
89+
90+
```jsx
91+
// path: ./config/middlewares.js
92+
93+
module.exports = [
94+
// ...
95+
{
96+
name: 'strapi::security',
97+
config: {
98+
contentSecurityPolicy: {
99+
useDefaults: true,
100+
directives: {
101+
'connect-src': ["'self'", 'https:'],
102+
'img-src': [
103+
"'self'",
104+
'data:',
105+
'blob:',
106+
'dl.airtable.com',
107+
'www.okta.com', // Base URL of the provider's logo
108+
],
109+
'media-src': [
110+
"'self'",
111+
'data:',
112+
'blob:',
113+
'dl.airtable.com',
114+
'www.okta.com', // Base URL of the provider's logo
115+
],
116+
upgradeInsecureRequests: null,
117+
},
118+
},
119+
},
120+
},
121+
// ...
122+
]
123+
124+
```
125+
126+
</code-block>
127+
128+
<code-block title="TYPESCRIPT">
129+
130+
```ts
131+
// path: ./config/middlewares.ts
132+
133+
export default [
134+
// ...
135+
{
136+
name: 'strapi::security',
137+
config: {
138+
contentSecurityPolicy: {
139+
useDefaults: true,
140+
directives: {
141+
'connect-src': ["'self'", 'https:'],
142+
'img-src': [
143+
"'self'",
144+
'data:',
145+
'blob:',
146+
'dl.airtable.com',
147+
'www.okta.com', // Base URL of the provider's logo
148+
],
149+
'media-src': [
150+
"'self'",
151+
'data:',
152+
'blob:',
153+
'dl.airtable.com',
154+
'www.okta.com', // Base URL of the provider's logo
155+
],
156+
upgradeInsecureRequests: null,
157+
},
158+
},
159+
},
160+
},
161+
// ...
162+
]
163+
164+
```
165+
166+
</code-block>
167+
</code-group>
168+
169+
:::
170+
86171
### The `createStrategy` Factory
87172

88173
A passport strategy is usually built by instantiating it using 2 parameters: the configuration object, and the verify function.
@@ -269,8 +354,6 @@ yarn add passport-github2
269354
</code-group>
270355

271356
::: details Configuration example for Github:
272-
273-
<br/>
274357
<code-group>
275358
<code-block title="JAVASCRIPT">
276359

@@ -309,6 +392,7 @@ module.exports = ({ env }) => ({
309392
});
310393

311394
```
395+
312396
</code-block>
313397

314398
<code-block title="TYPESCRIPT">
@@ -419,12 +503,10 @@ module.exports = ({ env }) => ({
419503
});
420504
```
421505

422-
423506
</code-block>
424507

425508
<code-block title="TYPESCRIPT">
426509

427-
428510
```jsx
429511
// path: ./config/admin.ts
430512

@@ -466,7 +548,6 @@ export default ({ env }) => ({
466548
</code-block>
467549
</code-group>
468550

469-
470551
:::
471552

472553
#### Microsoft
@@ -537,7 +618,6 @@ module.exports = ({ env }) => ({
537618
});
538619
```
539620

540-
541621
</code-block>
542622

543623
<code-block title="TYPESCRIPT">
@@ -587,9 +667,6 @@ export default ({ env }) => ({
587667
</code-block>
588668
</code-group>
589669

590-
591-
592-
593670
:::
594671

595672
#### Keycloak (OpenID Connect)
@@ -726,6 +803,10 @@ yarn add passport-okta-oauth20
726803

727804
</code-group>
728805

806+
::: caution
807+
When setting the `OKTA_DOMAIN` environment variable, make sure to include the protocol (e.g. `https://example.okta.com`). If you do not, you will end up in a redirect loop.
808+
:::
809+
729810
::: details Configuration example for Okta:
730811
<br/>
731812

@@ -811,7 +892,6 @@ export default ({ env }) => ({
811892
</code-block>
812893
</code-group>
813894

814-
815895
:::
816896

817897
## Performing advanced customization
@@ -851,7 +931,6 @@ const strategyInstance = new Strategy(configuration, ({ email, username }, done)
851931
});
852932
```
853933

854-
855934
</code-block>
856935

857936
<code-block title="TYPESCRIPT">
@@ -871,11 +950,9 @@ const strategyInstance = new Strategy(configuration, ({ email, username }, done)
871950
});
872951
```
873952

874-
875953
</code-block>
876954
</code-group>
877955

878-
879956
### Authentication Events
880957

881958
The SSO feature adds a new [authentication event](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md#available-options): `onSSOAutoRegistration`.
@@ -908,8 +985,6 @@ module.exports = () => ({
908985
});
909986
```
910987

911-
912-
913988
</code-block>
914989

915990
<code-block title="TYPESCRIPT">
@@ -936,7 +1011,5 @@ export default () => ({
9361011
});
9371012
```
9381013

939-
9401014
</code-block>
9411015
</code-group>
942-

0 commit comments

Comments
 (0)