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

[BUG] SignUp with Keycloak OCID fails due to refresh_expires_in #2444

Closed
1 of 2 tasks
gdnmhr opened this issue Apr 13, 2024 · 3 comments · Fixed by #2445
Closed
1 of 2 tasks

[BUG] SignUp with Keycloak OCID fails due to refresh_expires_in #2444

gdnmhr opened this issue Apr 13, 2024 · 3 comments · Fixed by #2445
Assignees
Labels
bug Something isn't working

Comments

@gdnmhr
Copy link
Contributor

gdnmhr commented Apr 13, 2024

Issue Summary

When using Keycloak as IDP, all sign-ups will fail. Keycloak includes the attribute refresh_expires_in in its response which cannot be handled by Formbricks.

Steps to Reproduce

  1. Setup Formbricks with Keycloak as IDP
  2. Sign-up as a new user

Expected behavior

The user should be created and logged in.

Other information

Log (tokens are redacted):

Invalid `prisma.account.create()` invocation:

{
  data: {
    provider: "openid",
    type: "oauth",
    providerAccountId: "provider_uuid",
    access_token: "some_access_token",
    expires_at: 1713036572,
    refresh_expires_in: 0,
    ~~~~~~~~~~~~~~~~~~
    token_type: "Bearer",
    id_token: "my_id_token",
    not-before-policy: 0,
    session_state: "some_state",
    scope: "openid email profile",
    userId: "some_id",
?   id?: String,
?   createdAt?: DateTime,
?   updatedAt?: DateTime,
?   refresh_token?: String | Null,
?   ext_expires_in?: Int | Null,
?   user?: UserCreateNestedOneWithoutAccountsInput
  }
}

Unknown argument `refresh_expires_in`. Available options are marked with ?." is an invalid header value.
    at webidl.errors.exception (node:internal/deps/undici/undici:1581:14)
    at webidl.errors.invalidArgument (node:internal/deps/undici/undici:1592:28)
    at _Headers.set (node:internal/deps/undici/undici:2173:31)
    at t.toResponse (/home/nextjs/apps/web/.next/server/chunks/7991.js:25:22019)
    at a (/home/nextjs/apps/web/.next/server/chunks/7991.js:25:19894)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async e.length.t (/home/nextjs/apps/web/.next/server/chunks/7991.js:25:20998)
    at async /home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:42484
    at async eI.execute (/home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:32486)
    at async eI.handle (/home/nextjs/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:43737)

Screenshots

No response

Environment

  • Formbricks Cloud (app.formbricks.com)
  • Self-hosted Formbricks

Desktop (please complete the following information)

- OS: Ubuntu with latest Docker image v 1.6.1
@gdnmhr gdnmhr added the bug Something isn't working label Apr 13, 2024
Copy link
Contributor

Thank you for opening your first issue! 🙏❤️ One of our team members will review it and get back to you as soon as it possible. 😊

@mattinannt
Copy link
Member

mattinannt commented Apr 15, 2024

@gdnmhr thanks for opening this issue. We will check what the best solution to this problem is :-)

@ShubhamPalriwala Can you please try if you can reproduce the problem and also check with the linked PR if the problem is solved with this :-)

@ShubhamPalriwala
Copy link
Contributor

Thanks for opening the issue! I was just able to reproduce the bug for signups due to the extra field as you suggested 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants