title: How to implement Facebook OIDC login on Next.js with NextAuth?
body: <p>I have implemented a regular (Auth2) Facebook login with NextAuth that works fine, but now, I have to switch to OIDC login and can't seem to implement it properly. I'm getting the following error message:</p>
  <p><code>[token_endpoint must be configured on the issuer](https://next-auth.js.org/errors#callback_oauth_error token_endpoint must be configured on the issuer TypeError: token_endpoint must be configured on the issuer)</code></p>
  <p>And this is my configuration on the Facebook Provider:</p>
  <pre class="lang-js prettyprint-override"><code>export default NextAuth({
    providers: [
      FacebookProvider({
        idToken: true,
        clientId: process.env.FBID,
        clientSecret: process.env.FBSECRET,
        wellKnown: &quot;https://www.facebook.com/.well-known/openid-configuration&quot;,
        token: {
          url: &quot;https://www.facebook.com/v11.0/dialog/oauth&quot;,
          params: { scope: &quot;openid email public_profile&quot; },
        },
      }),
    ],
    secret: &quot;sunSAd2RkCajg2DLR3+5MfsinFwws8ZuzfPm2C+FXkc=&quot;,
  });
  </code></pre>