最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - Node OIDC Provider with Next.js (NextAuth) - "interaction session not found" when switching users -

programmeradmin0浏览0评论

I'm using node-oidc-provider as my OpenID Connect provider, with multiple Next.js (14 and 15) applications acting as clients. All clients use NextAuth.js for authentication and always request prompt=login when initiating authentication. The clients are configured using the /.well-known/openid-configuration served by node-oidc-provider. node-oidc-provider is served using expressjs.

However, when switching users, I get the following error:

POST <my oidc prefix>/session/end/confirm

error: invalid_request
error_description: interaction session not found

These are the steps I perform when switching users:

  1. Log in from a Next.js 15 client using NextAuth.js (prompt=login).
  2. Log out (only from NextAuth, not explicitly from the OIDC provider).
  3. Log in again with prompt=login.
  4. If logging in with the same user, everything works fine.
  5. If logging in with a different user, I receive the error above.

Why does this error occur only when switching users, and how can I properly handle user switching while using prompt=login?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论