Open AsbDaryaee opened 1 month ago
Can you first check if you have the most current version and if you use Nuxt SSR? There were some changes in route handling in the last few versions. For further troubleshooting I would need your oidc nuxt config and .env (if applies) of course without secrets and other sensitive info.
I use v0.12.0
and Yes I do use SSR for my project.
And this is my config from nuxt.config.ts
file:
oidc: {
defaultProvider: "oidc",
providers: {
oidc: {
clientId: [Client ID],
clientSecret: [Client Secret],
redirectUri: "[Address]/auth/oidc/callback",
scope: [
"openid",
"profile",
"offline_access",
"page_api",
],
responseMode: "query",
responseType: "code",
authorizationUrl: "[address]/connect/authorize",
tokenUrl: "[Address]/connect/token",
userinfoUrl: "[Address]/connect/userinfo",
logoutUrl: "[Address]/connect/endsession",
pkce: true,
tokenRequestType: "form-urlencoded",
exposeAccessToken: true,
},
},
middleware: {
globalMiddlewareEnabled: false,
customLoginPage: false,
},
session: {
expirationCheck: true,
automaticRefresh: true,
maxAge: 3600 * 24 * 2, // 2 Days
},
},
Please update to the most current version and verify, if the problems are still the same. Which oidc provider do you use, so I can check if I am able to reproduce? If your OIDC provider doesn't support the state challenge, you can disable that. There are 3 significant settings provided in nuxt-oidc-auth for this:
Option | Type | Default | Description |
---|---|---|---|
pkce | boolean (optional) |
false |
Use PKCE (Proof Key for Code Exchange) |
state | boolean (optional) |
true |
Use state parameter with a random value. If state is not used, the nonce parameter is used to identify the flow. |
nonce | boolean (optional) |
false |
Use nonce parameter with a random value. |
After updating to the latest version, I no longer receive reports about this issue. However, I was able to reproduce the error under specific conditions: If a user takes a long time to log in (approximately 5 minutes), the cookie that library creates expires. When the user finally returns to the callback page, they encounter an error. It seems that the library might occasionally fail to initialize correctly or handle the deletion of the old cookie, which leads to this error.
After updating to the latest version, I no longer receive reports about this issue. However, I was able to reproduce the error under specific conditions: If a user takes a long time to log in (approximately 5 minutes), the cookie that library creates expires. When the user finally returns to the callback page, they encounter an error. It seems that the library might occasionally fail to initialize correctly or handle the deletion of the old cookie, which leads to this error.
Hi @AsbDaryaee, this is currently by design, as 5 minutes should be more than enough to return to the callback page in case you are doing a registration etc.. This will be a configurable setting in one of the later version.
Thank you @itpropro
Hi, I've been using
nuxt-oidc-auth
for a while and everything seems fine, but some users have trouble with authentication. When user is done with authentication and redirects to theredirectUri
, the error appears.I Checked the console and the error below was there:
Also this message was in my terminal:
WARN [Vue Router warn]: No match found for location with path "/auth/oidc/login"
Can anyone help me figure it out and fix the problem?