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

fix: issue with refreshing token when client_secret is not set #513

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anna-romanova
Copy link

Fix for #506

Problem: The support for PKCE (Proof Key for Code Exchange) was introduced in the library, making the client_secret field optional (see commit e6afdfb). However, the client_secret field is still included in the list of validated fields in the refresh() method (Service.js#L667).

Issue: When creating a client without setting a client_secret (using PKCE for authentication), the token cannot be refreshed after its default expiration of one hour. This is because the validation check in the refresh() method expects a client_secret, causing an error in the PKCE flow.

Proposed Fix: Adjust the validation logic in the refresh() method to account for the possibility that the client_secret is not provided when using PKCE. This ensures that the token can still be refreshed in the absence of a client_secret.

@anna-romanova anna-romanova changed the title Fix issue with refreshing token when client_secret is not set fix: issue with refreshing token when client_secret is not set Feb 19, 2025
@anna-romanova anna-romanova marked this pull request as ready for review February 19, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants