Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Cognito provider #6917

Merged
merged 28 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7204dde
Adding support to for grant object subdomain property assignment
ralphsomeday Jul 6, 2020
9e35d1a
Adding instructions on how to configure a customer provider subdomain
ralphsomeday Jul 6, 2020
bb2ff5a
[strapi] pass the subdomain from grantConfig
JiboStore Sep 8, 2020
c0406f9
Merge pull request #1 from JiboStore/master
ralphsomeday Sep 8, 2020
9f9ef94
removing section about subdomain for auth provider to add the change …
ralphsomeday Sep 8, 2020
45485b6
Adding the right custom property 'cognito host' + updating the docume…
ralphsomeday Sep 8, 2020
2058eec
Changing amazon icon to aws as the amazon login provider is different…
ralphsomeday Sep 9, 2020
2bebc61
Removed env var for cognito host subdomain and added an extra subdoma…
ralphsomeday Sep 22, 2020
2df2a62
solving merge conflicts
ralphsomeday Sep 28, 2020
64dfe7d
commit to solve some merge conflicts
ralphsomeday Sep 28, 2020
1b077fc
solving merge conflicts
ralphsomeday Sep 28, 2020
f409dfa
Merge branch 'master' into master
ralphsomeday Sep 28, 2020
48ac474
Adding AWS Cognito provider configuration and key in all language fil…
ralphsomeday Sep 28, 2020
a4a531f
Adding AWS Cognito provider configuration and key in all language fil…
ralphsomeday Sep 28, 2020
36a8a4e
Merge branch 'master' of https://github.com/ralphsomeday/strapi
ralphsomeday Sep 28, 2020
233e5d2
Merge branch 'master' into master
alexandrebodin Sep 29, 2020
d46881f
Merge branch 'master' into master
ralphsomeday Sep 29, 2020
d26ecf4
adding subdomain to aws cognito provider+only showing the subdomain p…
ralphsomeday Sep 29, 2020
278f790
fixing some warnings and react errors that came out from the travis b…
ralphsomeday Sep 30, 2020
09fa46f
fixing lint issue
ralphsomeday Sep 30, 2020
c6498ac
Taking into account feedback from soupette
ralphsomeday Sep 30, 2020
f72bb80
Updating code to take into account soupette feedback
ralphsomeday Sep 30, 2020
1dfd824
Merge branch 'master' into master
ralphsomeday Oct 3, 2020
a3b94a7
Updating documentation with AWS Cognito provider configuration in use…
ralphsomeday Oct 3, 2020
63a6cfc
Updating doc using Pierre feedback and adding a provider for aws cogn…
ralphsomeday Oct 5, 2020
e8fe42c
Merge branch 'master' into master
ralphsomeday Oct 5, 2020
f8efa5d
Updating the redirect URL to the front-end app
ralphsomeday Oct 5, 2020
ef0fc1f
Merge branch 'master' into master
petersg83 Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/v3.x/plugins/users-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,3 +778,27 @@ module.exports = {
::: tip
You can learn more on configuration in the documentation [here](../concepts/configurations.md)
:::

## Custom providers subdomain configuration

Some external Identity providers like AWS Cognito will require you to provide the link to the IDP host url (e.g. your_idp_name.auth.eu-central-1.amazoncognito.com) so that you can access the IDP login page using `htts://your_strapi_url/connect/your_custom_provider_name`. In order to do that you will have to add the following property `customProviderHost` in your config > server.js file:

```js
module.exports = ({
env
}) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
customProviderHost: 'your_idp_name.auth.eu-central-1.amazoncognito.com', // add this property to configure the subdomain property for your custom provider
admin: {
autoOpen: false,
url: '/adminpanel'
},
proxy: {
enabled: false
},
cron: {
enabled: false
}
})
```
4 changes: 4 additions & 0 deletions packages/strapi-plugin-users-permissions/controllers/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ module.exports = {
// Ability to pass OAuth callback dynamically
grantConfig[provider].callback = _.get(ctx, 'query.callback') || grantConfig[provider].callback;
grantConfig[provider].redirect_uri = `${strapi.config.server.url}/connect/${provider}/callback`;
if (strapi.config.server.customProviderHost && strapi.config.server.customProviderHost !== '') {
// Adding subdomain to grant object
grantConfig[provider].subdomain = strapi.config.server.customProviderHost;
}

return grant(grantConfig)(ctx, next);
},
Expand Down