Open amirmdehghanpour opened 1 month ago
Can you share your config?
yes this is my .env file
` ENCRYPTION_SECRET=xxxxxxxxxxxxx
DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
NODE_OPTIONS=--no-node-snapshot
NEXTAUTH_URL=https://app.setadeiran.com NEXT_PUBLIC_VIEWER_URL=https://bot.setadeiran.com
ADMIN_EMAIL=amirm.dehghanpour@gmail.com
SMTP_USERNAME=xxxxxxxxxxxxxxxx SMTP_PASSWORD=xxxxxxxxxxxx SMTP_HOST=mail.setadeiran.com SMTP_PORT=465 NEXT_PUBLIC_SMTP_FROM="'Typebot Notifications' info@setadeiran.com"
KEYCLOAK_CLIENT_ID=typebot
KEYCLOAK_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxx
KEYCLOAK_REALM=master
KEYCLOAK_BASE_URL=https://key.amirmdehghanpour.ir/
and this is my keycloak conf
{
"realm": "master",
"auth-server-url": "https://key.amirmdehghanpour.ir/",
"ssl-required": "external",
"resource": "typebot",
"credentials": {
"secret": "xxxxxxxxxxxxxxxxxx
"
},
"confidential-port": 0
}`
Have you tried KEYCLOAK_BASE_URL=https://key.amirmdehghanpour.ir/ without end slash?
yes i tried but no change effect its get same error
I am not familiar with Keycloak so I am running out of idea 🤔
The error is OPError: Unable to find matching target resource method (For more on this error consult the server log at the debug level.)
how fix it?
i check the typebot log in docker and get this again!!!
Hi, @amirmdehghanpour, I checked, and your error seems similar to one I encountered.
I was able to authenticate successfully via Keycloak with the following settings:
Make sure to use double quotes for KEYCLOAK_CLIENT_ID and KEYCLOAK_CLIENT_SECRET.
The KEYCLOAK_BASE_URL needs to include /auth/realms in your Keycloak domain. For example: https://yourdomainkeycloak/auth/realms
In the Keycloak admin interface, I configured it as follows:
Let me know if this works for you too!
Hi, @amirmdehghanpour, I checked, and your error seems similar to one I encountered.
I was able to authenticate successfully via Keycloak with the following settings:
* Make sure to use double quotes for KEYCLOAK_CLIENT_ID and KEYCLOAK_CLIENT_SECRET. * The KEYCLOAK_BASE_URL needs to include /auth/realms in your Keycloak domain. For example: https://yourdomainkeycloak/auth/realms
In the Keycloak admin interface, I configured it as follows:
Let me know if this works for you too!
hi @brmattge i change env like you say but didint work
hi i conf my keycloak server same as doc but i get error Try signing with a different account. and when i check log of docker get this
[next-auth][error][SIGNIN_OAUTH_ERROR] https://next-auth.js.org/errors#signin_oauth_error Unable to find matching target resource method (For more on this error consult the server log at the debug level.) { error: { message: 'Unable to find matching target resource method (For more on this error consult the server log at the debug level.)', stack: 'OPError: Unable to find matching target resource method (For more on this error consult the server log at the debug level.)\n' + ' at processResponse (/app/node_modules/.pnpm/openid-client@5.6.5/node_modules/openid-client/lib/helpers/process_response.js:38:13)\n' + ' at Issuer.discover (/app/node_modules/.pnpm/openid-client@5.6.5/node_modules/openid-client/lib/issuer.js:151:18)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + ' at async openidClient (/app/node_modules/.pnpm/next-auth@4.22.1_next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0___am5p4555usmjvg5xfootnx4hbe/node_modules/next-auth/core/lib/oauth/client.js:16:14)\n' + ' at async getAuthorizationUrl (/app/node_modules/.pnpm/next-auth@4.22.1_next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0___am5p4555usmjvg5xfootnx4hbe/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:18)\n' + ' at async Object.signin (/app/node_modules/.pnpm/next-auth@4.22.1_next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0___am5p4555usmjvg5xfootnx4hbe/node_modules/next-auth/core/routes/signin.js:38:24)\n' + ' at async AuthHandler (/app/node_modules/.pnpm/next-auth@4.22.1_next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0___am5p4555usmjvg5xfootnx4hbe/node_modules/next-auth/core/index.js:260:26)\n' + ' at async NextAuthApiHandler (/app/node_modules/.pnpm/next-auth@4.22.1_next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0___am5p4555usmjvg5xfootnx4hbe/node_modules/next-auth/next/index.js:22:19)\n' + ' at async z (/app/apps/builder/.next/server/chunks/5043.js:1:8413)\n' + ' at async K (/app/node_modules/.pnpm/next@14.1.0_@babel+core@7.24.0_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16545)', name: 'OPError' }, providerId: 'keycloak', message: 'Unable to find matching target resource method (For more on this error consult the server log at the debug level.)' }
and this is Screenshot of the error when i click to login with keycloak i get