title: Next-Auth Okta Authorization code with PKCE
body: <p>I am trying to integrate a NextJS application with Okta, using the Authorization code flow with PKCE. The flow is not complete because the token request is not being performed.</p>
  <p>This is the configuration for the provider:</p>
  <pre><code>import NextAuth from 'next-auth';
  
  const oktaBaseUrl = 'https://my-okta-domain.com/oauth2/[auth-server-id]';
  const clientId = '[My Client Id]';
  
  const authorizationUrl =
    oktaBaseUrl +
    '/v1/authorize?response_type=code&amp;response_mode=query&amp;state=false';
  
  const accessTokenUrl = oktaBaseUrl + '/v1/token';
  const profileUrl = oktaBaseUrl + '/v1/userinfo';
  
  export default NextAuth({
    providers: [
      {
        id: 'okta',
        name: 'Okta',
        type: 'oauth',
        version: '2.0',
        protection: 'pkce',
        clientId,
        clientSecret: '',
        accessTokenUrl,
        authorizationUrl,
        profileUrl,
        scope: 'services',
        params: {
          grant_type: 'authorization_code',
        },
        profile(profile) {
          return {
            id: profile.id as string,
            name: profile.name,
            email: profile.email
          };
        }
      }
    ],
  });
  
  </code></pre>
  <p>Thefirst stage seems to be perfromed correctly, but when okta returns the code, I only see a message in my application showing an 403 code. It seems it is trying to get the code without perform the request to the token endpoint</p>
  <p><img src="https://user-images.githubusercontent.com/24439949/118904820-d8389b80-b8d7-11eb-83d1-af659dfb560f.png" alt="image" /></p>
  <p>Message in console:</p>
  <pre><code>[next-auth][error][oauth_get_access_token_error]
  https://next-auth.js.org/errors#oauth_get_access_token_error { statusCode: 403, data: '' } okta y64EzO0u9ZbwqFdjJWqapXggDmC1bWx2DGQaITCpta4
  [next-auth][error][oauth_callback_error]
  https://next-auth.js.org/errors#oauth_callback_error { statusCode: 403, data: '' }
  
  </code></pre>
  <p>Is there a configuration I am missing?</p>