Closed zhangwei900808 closed 7 months ago
The reason you get the kind of error you reported is because Auth.js encrypts JWTs by default (JWE). Auth.js JWTs are not meant for third-party APIs. You need an identity provider that issues access_tokens. That said, you have the jwt.encode
and jwt.decode
options available to issue a JWT format your backend accepts. This is condiered an advanced option, use it at your own risk:
https://authjs.dev/reference/core/jwt#encode-1 https://authjs.dev/reference/core/jwt#decode-2
@balazsorban44 Thks your reply , I sure what I should do 👍
Environment
System: OS: macOS 14.4.1 CPU: (10) arm64 Apple M1 Max Memory: 2.58 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - /usr/local/bin/node npm: 10.2.4 - /usr/local/bin/npm pnpm: 8.6.12 - ~/Library/pnpm/pnpm Browsers: Chrome: 123.0.6312.123 Edge: 123.0.2420.97 Safari: 17.4.1 npmPackages: next: 14.2.1 => 14.1.4 next-auth: 5.0.0-beta.16 => 5.0.0-beta.16 react: ^18 => 18.2.0
Reproduction URL
https://github.com/zhangwei900808/next-auth-redux
Describe the issue
java get jwt token in cookies,but when I parse it is error
How to reproduce
1、install next.js and next-auth 2、config auth.js 3、send a invoke to backend 4、java parse jwt token
Expected behavior
java can parse next-auth generate token and get user info in it