documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[Request]: Please add more details to "Adding a new provider (to your project)"

Open dpoerschke opened this issue 3 years ago • 0 comments

Summary

My scenario: I try to use KeyCloak together with Strapi. When the user calls my web application, he is redirected to the login page of KeyCloak, logs in and then returns to the web application. Some functions in the web application call Strapi services. My goal is to have Strapi then accept these calls, since the user has already previously authenticated to KeyCloak. I assume that I need to configure KeyCloak as a custom provider in Strapi to achieve this but I'm not sure.

The issue: Regarding Provider.js and bootstrap.js the documentation says:

If these files don't exist you will need to copy from your node_modules or the Strapi mono-repo. You can see plugin extensions for more information on how it works.

I found the Provider.js in the folder node_modules/strapi_plugin_users_permissions and copied it to my-project\extensions\users-permissions\services. So far so good. But when I search for bootstrap.js there are several occurences with different filesize. Question 1: Am I correct in assuming that node_modules/strapi_plugin_users_permissions/config/bootstrap.js is the correct one to use?

Question 2: After reading configure-your-oauth-generic-information I'm completely lost. What do I have to enter in case of KeyCloak?

Why is it needed?

I'm not sure what bootstrap.js-file is the correct one and I have no idea if I am doing the right thing to achieve my goal. Strapi isn't starting anymore - the copied bootstrap.js is the cause: [2021-11-24T16:54:56.195Z] debug ⛔️ Server wasn't able to start properly. [2021-11-24T16:54:56.197Z] error Error: Cannot find module '../users-permissions-actions'

I had to correct the path in the following line of bootstrap.js: const usersPermissionsActions = require('../../../../node_modules/strapi-plugin-users-permissions/config/users-permissions-actions');

Suggested solution(s)

Please describe more detailed from where to copy Provider.js and bootstrap.js. The link to plugin extensions unfortunately didn't help me. Please describe how to use Strapi with KeyCloak.

Related issue(s)/PR(s)

No response

dpoerschke avatar Nov 24 '21 15:11 dpoerschke