Skip to content

Error when using oauth with provider linkedin_oidc - Error getting user profile from external provider #1533

Description

@omerhochman

Version

@nuxtjs/supabase: tried both v1.2.0 and v0.3.8
nuxt: v3.6.5

When using signInWithOAuth with linkedin_oidc

const client = useSupabaseClient()
const result = await client.auth.signInWithOAuth({
    provider: 'linkedin_oidc',
    options: {
        redirectTo: '...'
    }
})

It redirects back to the redirectTo URL with the following query params:
error=server_error&error_code=500&error_description=Error+getting+user+profile+from+external+provider#error=server_error&error_code=500&error_description=Error+getting+user+profile+from+external+provider

When checking the Auth logs in the Supabase platform I found this error:
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

Activity

  1. added
    bug
    on Apr 14, 2024
  2. J0 commented on Apr 15, 2024

    @J0
    Contributor

    Thanks for reporting this! afaik we haven't changed anything w.r.t the provider. Checking if anything changed upstream

  3. added a commit that references this issue on Apr 15, 2024
  4. kangmingtay commented on Apr 15, 2024

    @kangmingtay
    Member

    @omerhochman @GaryAustin1 something definitely changed on linkedin's end :( even their documentation is inconsistent - the discovery document shows the issuer with the /oauth prefix but the docs has the issuer without it...

  5. added a commit that references this issue on Apr 15, 2024
    10d6d8b
  6. added a commit that references this issue on Apr 15, 2024
  7. omerhochman commented on Apr 17, 2024

    @omerhochman
    ContributorAuthor

    Looks like the issue is fixed, signInWithOAuth with linkedin_oidc works again!

  8. jagatfx commented on Apr 17, 2024

    @jagatfx

    I am still seeing the oidc: id token issued by a different provider. Is this potentially not fully rolled out?

  9. ahmedivy commented on Apr 19, 2024

    @ahmedivy

    @omerhochman Do I need to update the version? because I am still getting this error.

  10. omerhochman commented on Apr 19, 2024

    @omerhochman
    ContributorAuthor

    Hey @jagatfx and @ahmedivy, I don't know why it fails for you, I did not change anything. They probably fixed an endpoint up here.

    I am actually using an old version of @nuxtjs/supabase as a module in my nuxt.config.js

    This is from my package.json

        "@nuxtjs/supabase": "^0.3.8",

    And this is the usage:

    const result = await authClient.auth.signInWithOAuth({
        provider: 'linkedin_oidc',
        options: {
          redirectTo: `${WEBAPP_URL}/onboarding`,
        },
      })

    Works for me.

  11. ahmedivy commented on Apr 19, 2024

    @ahmedivy

    @omerhochman I am using with Nextjs

    "@supabase/ssr": "^0.3.0",
    "@supabase/supabase-js": "^2.42.4",
    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);
    };
  12. charlieram96 commented on Apr 20, 2024

    @charlieram96

    @ahmedivy Were you able to get this issue fixed on your end? I am having the same issue.

  13. jagatfx commented on Apr 20, 2024

    @jagatfx

    Hey @jagatfx and @ahmedivy, I don't know why it fails for you, I did not change anything. They probably fixed an endpoint up here.

    I am actually using an old version of @nuxtjs/supabase as a module in my nuxt.config.js

    This is from my package.json

        "@nuxtjs/supabase": "^0.3.8",

    And this is the usage:

    const result = await authClient.auth.signInWithOAuth({
        provider: 'linkedin_oidc',
        options: {
          redirectTo: `${WEBAPP_URL}/onboarding`,
        },
      })

    Works for me.

    Thanks. I had to write into support and have them change a piece of my infrastructure setup. My GoTrue version was stuck at 2.148.0 but the fix is in 2.149.0. The settings are at https://supabase.com/dashboard/project/_/settings/infrastructure.

    Screenshot 2024-04-18 at 11 01 38 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions