supabase / auth

A JWT based API for managing users and issuing JWT tokens

Home Page:https://supabase.com/docs/guides/auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LinkedIn Auth Errror - OIDC: id token issued by a different provider

ahmedivy opened this issue · comments

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

LinkedIN Authentication throws the following error in dev server:
http://localhost:3000/auth/auth-code-error#error=server_error&error_code=500&error_description=Error+getting+user+profile+from+external+provider

and this is the error in supabase auth logs:
Log Event Message {component":"api","error":"oidc: id token issued by a different provider, expected \"https://www.linkedin.com\" got \"https://www.linkedin.com/oauth\"","level":"error","method":"GET","msg":"500: Error getting user profile from external provider","path":"/callback","referer":"http://localhost:3000","remote_addr":"10*.**.*.*","time":"2024-04-19T18:16:37Z","timestamp":"2024-04-19T18:16:37Z"}

To Reproduce

I am using Nextjs with following versions of supabase:

"@supabase/ssr": "^0.3.0",
"@supabase/supabase-js": "^2.42.4",

Calling this server action from client slide

export const linkedInSignIn = async () => {
  const supabase = createClient();
  const origin = headers().get("origin");

  const { data, error } = await supabase.auth.signInWithOAuth({
    provider: "linkedin_oidc",
    options: {
      redirectTo: `${origin}/auth/callback`,
    },
  });

  if (error) {
    return redirect("/login?message=Could not authenticate user");
  }

  redirect(data.url);
};

Expected behavior

I expect it to login to LinkedIn without this error.

Its fixed now by bumping GoTrue on Supabase Infrastructure

@ahmedivy how can i bump the GoTrue version?
sorry im new to supabase

You have to contact supabase support

Thanks for opening this @ahmedivy. I've got the same issue.

hey @ahmedivy, I got the same issue, thanks for posting this. I contacted support and they told me that I can upgrade the supabase image in /settings/infrastructure in the Supabase dashboard, but I can't update anything there. Is it because I'm on the free plan?

hey @ahmedivy, I got the same issue, thanks for posting this. I contacted support and they told me that I can upgrade the supabase image in /settings/infrastructure in the Supabase dashboard, but I can't update anything there. Is it because I'm on the free plan?

No, i was also on the free plan. Maybe they thought that you want to upgrade postgres version.

You can try to contact again and tell that you have this issue with linkedin and need to upgrade GoTrue version to the latest, that can't be upgraded from the dashboard.

@ahmedivy yea I got a response back from them. Thanks!