Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: "[ERROR] cognito - silent renew failed" but "isAuthenticated" remained "true" #2059

Open
moky80 opened this issue Dec 30, 2024 · 0 comments

Comments

@moky80
Copy link

moky80 commented Dec 30, 2024

Version

19.0.0

Please provide a link to a minimal reproduction of the bug

moky80/test-angular-auth-oidc-client@42f9185

Please provide the exception or error you saw

[ERROR] cognito - silent renew failed! Error: Error: no refresh token found, please login

The complete log:
https://github.com/moky80/test-angular-auth-oidc-client/blob/42f91852be14ae8974a65fe0a0c24484bf6ad9a9/log/20241230-cognito-authenticated-silentRenew_once_but_not_again.log#L1979C24-L1979C113

Steps to reproduce the behavior

- Setup Cognito User Pool: session token expiration 5 minutes, refresh token expiration 5 days.
- AuthConfig with `silentRenew` and `useRefreshToken` enabled, `allowUnsafeReuseRefreshToken` disabled: https://github.com/moky80/test-angular-auth-oidc-client/blob/42f91852be14ae8974a65fe0a0c24484bf6ad9a9/src/app/auth/auth.config.ts#L6
- Login a user: session and refresh tokens are gotten
- Wait 5 minutes: session token is expired, refresh token is used to get a new session token
- Wait another 5 minutes: session token is expired, see error message `[ERROR] cognito - silent renew failed! Error: Error: no refresh token found, please login` (this is expected because Cognito does not support refresh token rotation https://repost.aws/en/questions/QUohnyWmF9Tiy8YdJx52sgww/cognito-does-not-support-the-rotation-of-refresh-tokens), `isAuthenticated` remained `true` (this is not expected)

A clear and concise description of what you expected to happen.

`isAuthenticated` is set to `false` in this case

Additional context

No response

@moky80 moky80 changed the title [Bug]: silentRenew with refresh token got new session token once but not any more (refresh token was removed) [Bug]: silentRenew with refresh token got new session token once but not any more (no refresh token found) Dec 30, 2024
@moky80 moky80 changed the title [Bug]: silentRenew with refresh token got new session token once but not any more (no refresh token found) [Bug]: "[ERROR] cognito - silent renew failed" but "isAuthenticated" remained "true" Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant