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

Implement Refresh Token Authentication API #65

Merged
merged 12 commits into from
Feb 13, 2025
Merged

Implement Refresh Token Authentication API #65

merged 12 commits into from
Feb 13, 2025

Conversation

kimitrii
Copy link
Owner

@kimitrii kimitrii commented Feb 13, 2025

Changes Made

This PR introduces the Refresh Token authentication API. It allows the refreshing of expired access tokens by submitting both the expired access token and the refresh token. Upon successful security validation and token match, the provided refresh token will be revoked, and new refresh and access tokens will be generated. The new refresh token will be set as an HttpOnly cookie in the response, enhancing security by preventing client-side access. This update improves the overall security of the authentication process and helps prevent the following attacks:

  • Cross-Site Scripting (XSS): By storing the refresh token in an HttpOnly cookie, it is inaccessible to JavaScript on the client-side, protecting it from XSS attacks.
  • Replay Attacks: The refresh token is revoked and replaced upon use, preventing replay attacks where the token could be reused by an attacker.
  • Man-in-the-Middle (MitM) Attacks: Secure connections (HTTPS) protect the refresh token from interception by attackers during transmission.
  • Cross-Site Request Forgery (CSRF): The HttpOnly cookie ensures that the refresh token is automatically sent only to the trusted domain, reducing the risk of CSRF attacks.

Additionally, the @cloudflare/workers-types and wrangler packages was updated to fix the package issue:

  • Esbuild enables any website to send any requests to the development server and read the response.

Changes Type

  • Bug fix
  • New feature

Checklist:

  • The changes do not generate new error logs or warnings.
  • I have added tests that prove the fix or new feature works as expected.
  • Both new and existing tests pass locally.

@kimitrii kimitrii changed the title Fix esbuild enables any website to send any requests to the development server and read the response Implement Refresh Token Authentication API Feb 13, 2025
@kimitrii kimitrii merged commit 9b50a54 into main Feb 13, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant