Git Product home page Git Product logo

Comments (7)

oliverlabs avatar oliverlabs commented on August 11, 2024 1

Facing similar issue with github oauth

I'll submit a PR to make instructions clearer. A few steps are missing or just not defined clearly.

from azurechat.

thivy avatar thivy commented on August 11, 2024 1

Facing similar issue with github oauth

I'll submit a PR to make instructions clearer. A few steps are missing or just not defined clearly.

Thank you for submitting the PR! I've approved and merged it to main

from azurechat.

thivy avatar thivy commented on August 11, 2024

@dcnsakthi have you configured Auth? You only need to configure GitHub or Azure AD.

or you can bring your own Auth provider https://next-auth.js.org/providers/

from azurechat.

dcnsakthi avatar dcnsakthi commented on August 11, 2024

Hi @thivy, Thanks for the response. Yes, I have GitHub auth enabled configured in .env.local file.

from azurechat.

oliverlabs avatar oliverlabs commented on August 11, 2024

I am experiencing the same issue and I configured Azure AD authentication.

UPD: I removed the double-quotes and double-checked the app registration details and the error disappeared.

However, I am getting the following error now:

[next-auth][error][JWT_SESSION_ERROR] 
https://next-auth.js.org/errors#jwt_session_error decryption operation failed {
  message: 'decryption operation failed',
  stack: 'JWEDecryptionFailed: decryption operation failed\n' +
    '    at gcmDecrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/runtime/decrypt.js:68:15)\n' +
    '    at decrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/runtime/decrypt.js:91:20)\n' +
    '    at flattenedDecrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js:117:52)\n' +
    '    at async compactDecrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:20:23)\n' +
    '    at async jwtDecrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/jwt/decrypt.js:10:23)\n' +
    '    at async Object.decode (webpack-internal:///(sc_server)/./node_modules/next-auth/jwt/index.js:44:25)\n' +
    '    at async Object.session (webpack-internal:///(sc_server)/./node_modules/next-auth/core/routes/session.js:25:34)\n' +
    '    at async AuthHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/core/index.js:161:37)\n' +
    '    at async getServerSession (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:129:21)\n' +
    '    at async userSession (webpack-internal:///(sc_server)/./features/auth/helpers.ts:16:21)\n' +
    '    at async Home (webpack-internal:///(sc_server)/./app/page.tsx:18:18)',
  name: 'JWEDecryptionFailed'
}

UPD-2: The guide was not clear about the Next Auth parameters. I originally thought that they can be removed from the .env.local file as I am using Azure AD, but they are needed. Additionally, comments does not seem to be allowed in the .env.local file. I removed the original comment and added back the NEXTAUTH_SECRET and NEXTAUTH_URL variables, and after authenticating I got redirected to http://localhost:3000/chat page, which got stuck in the Loading... phase.

The console reads:

[next-auth][warn][EXPERIMENTAL_API]
`getServerSession` is used in a React Server Component.
https://next-auth.js.org/configuration/nextjs#getServerSession}
https://next-auth.js.org/warnings#EXPERIMENTAL_API
- wait compiling /middleware (client and server)...
- event compiled successfully in 2.6s (148 modules)
- wait compiling /chat/page (client and server)...
- event compiled client and server successfully in 9.5s (2370 modules)
[next-auth][warn][EXPERIMENTAL_API]
`getServerSession` is used in a React Server Component.
https://next-auth.js.org/configuration/nextjs#getServerSession}
https://next-auth.js.org/warnings#EXPERIMENTAL_API

UPD-3: Everything works as described. I had to deploy my own CosmosDB instance and define the variables in an .env.local file in order for a localhost version to run properly.

One comment is it takes an absolute age for the app to start up. I wonder if it is resource heavy or just not optimised.

from azurechat.

akashtalole avatar akashtalole commented on August 11, 2024

Facing similar issue with github oauth

from azurechat.

thivy avatar thivy commented on August 11, 2024

Merged the updated documentation to main

from azurechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.