From ed270d2679ce8f8594b4b7ae969dfd6e4bdd01ad Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 19 Nov 2021 14:32:38 +0100 Subject: [PATCH 1/5] Fix path for config files (now in admin config) --- .../configurations/optional/sso.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index ad6895b0f4..f2cd59fb55 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -21,7 +21,7 @@ Single Sign-On on Strapi allows you to configure additional sign-in and sign-up It is currently not possible to associate a unique SSO provider to an email address used for a Strapi account, meaning that the access to a Strapi account cannot be restricted to only one SSO provider. For more information and workarounds to solve this issue, [please refer to the dedicated GitHub issue](https://github.com/strapi/strapi/issues/9466#issuecomment-783587648). ::: -SSO configuration lives in the server configuration of the application, found at `/config/server.js`. +SSO configuration lives in the server configuration of the application, found at `/config/admin.js`. ## Accessing the configuration @@ -132,7 +132,7 @@ yarn add passport-google-oauth2 ::: details Configuration example for Google: ```jsx -// path: ./config/server.js +// path: ./config/admin.js 'use strict'; @@ -201,7 +201,7 @@ yarn add passport-github2 ::: details Configuration example for Github: ```jsx -// path: ./config/server.js +// path: ./config/admin.js 'use strict'; @@ -265,7 +265,7 @@ yarn add passport-discord ::: details Configuration example for Discord: ```jsx -// path: ./config/server.js +// path: ./config/admin.js 'use strict'; @@ -329,7 +329,7 @@ yarn add passport-azure-ad-oauth2 jsonwebtoken ::: details Configuration example for Microsoft: ```jsx -// path: ./config/server.js +// path: ./config/admin.js 'use strict'; @@ -399,7 +399,7 @@ yarn add passport-okta-oauth20 ::: details Configuration example for Okta: ```jsx -// path: ./config/server.js +// path: ./config/admin.js 'use strict'; @@ -476,14 +476,14 @@ const strategyInstance = new Strategy(configuration, ({ email, username }, done) ### Authentication Events -The SSO feature adds a new [authentication event](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md#available-options): `onSSOAutoRegistration`. +The SSO feature adds a new [authentication event](/developer-docs/latest/setup-deployment-guides/configurations/required/admin.md#available-options): `onSSOAutoRegistration`. This event is triggered whenever a user is created using the auto-register feature added by SSO. It contains the created user (`event.user`), and the provider used to make the registration (`event.provider`). Example: -`/config/server.js` +`/config/admin.js` ```javascript module.exports = () => ({ From fa7bd44bf56c434606ccd5058500f02552a7ea9d Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 19 Nov 2021 14:32:50 +0100 Subject: [PATCH 2/5] Update heading level --- .../setup-deployment-guides/configurations/optional/sso.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index f2cd59fb55..0c3f4ea22d 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -59,9 +59,7 @@ The `uid` property is the unique identifier of each strategy and is generally fo A passport strategy is usually built by instantiating it using 2 parameters: the configuration object, and the verify function. - - -**Configuration Object** +#### Configuration Object The configuration object depends on the strategy needs, but often asks for a callback URL to be redirected to once the connection has been made on the provider side. From e69292cc02a0768897c06c719d923909352fe4f4 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 19 Nov 2021 14:32:59 +0100 Subject: [PATCH 3/5] Add missing paths in code examples --- .../configurations/optional/sso.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index 0c3f4ea22d..e099c81279 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -460,6 +460,8 @@ The easiest way to do so is to plug into the verify function of your strategy an For example, if you want to allow only people with an official strapi.io email address, you can instantiate your strategy like this: ```javascript +// path: ./config/admin.js + const strategyInstance = new Strategy(configuration, ({ email, username }, done) => { // If the email ends with @strapi.io if (email.endsWith('@strapi.io')) { @@ -479,11 +481,9 @@ The SSO feature adds a new [authentication event](/developer-docs/latest/setup-d This event is triggered whenever a user is created using the auto-register feature added by SSO. It contains the created user (`event.user`), and the provider used to make the registration (`event.provider`). -Example: - -`/config/admin.js` - ```javascript +// path: ./config/admin.js + module.exports = () => ({ // ... admin: { From b9afaa176559588aaac14e31a8428b7573a592b1 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 19 Nov 2021 14:34:33 +0100 Subject: [PATCH 4/5] Update docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md --- .../setup-deployment-guides/configurations/optional/sso.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index e099c81279..c7a76d6841 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -21,7 +21,7 @@ Single Sign-On on Strapi allows you to configure additional sign-in and sign-up It is currently not possible to associate a unique SSO provider to an email address used for a Strapi account, meaning that the access to a Strapi account cannot be restricted to only one SSO provider. For more information and workarounds to solve this issue, [please refer to the dedicated GitHub issue](https://github.com/strapi/strapi/issues/9466#issuecomment-783587648). ::: -SSO configuration lives in the server configuration of the application, found at `/config/admin.js`. +SSO configuration lives in the server configuration of the application, found at `./config/admin.js`. ## Accessing the configuration From 84112ab57ea993869404b898a66453eadcb2a0f2 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Fri, 19 Nov 2021 14:35:22 +0100 Subject: [PATCH 5/5] Update docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md --- .../setup-deployment-guides/configurations/optional/sso.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index c7a76d6841..e0ec8ea69b 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -476,7 +476,7 @@ const strategyInstance = new Strategy(configuration, ({ email, username }, done) ### Authentication Events -The SSO feature adds a new [authentication event](/developer-docs/latest/setup-deployment-guides/configurations/required/admin.md#available-options): `onSSOAutoRegistration`. +The SSO feature adds a new [authentication event](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md#available-options): `onSSOAutoRegistration`. This event is triggered whenever a user is created using the auto-register feature added by SSO. It contains the created user (`event.user`), and the provider used to make the registration (`event.provider`).