Skip to content

ClientCredentials flow to refresh expired tokens - #22

Merged
lacc merged 2 commits into
mainfrom
clientCredentialsRefreshToken
Aug 29, 2025
Merged

ClientCredentials flow to refresh expired tokens#22
lacc merged 2 commits into
mainfrom
clientCredentialsRefreshToken

Conversation

@lacc

@lacc lacc commented Aug 29, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings August 29, 2025 16:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements automatic token refresh for expired tokens in the OAuth client credentials flow, replacing the previous behavior of returning an Unauthorized response with a new flow that attempts to exchange client credentials for a fresh token.

  • Removes the immediate Unauthorized response when tokens are expired
  • Restructures control flow to attempt token refresh for both expired and missing tokens
  • Updates test cases to verify new token exchange behavior and proper error handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ClientCredentialsAccessTokenBuilder.cs Modifies expired token handling to continue with refresh flow instead of returning Unauthorized
BasicOAuthBearerTokenHandler_ClientCredentialsFlowTest.cs Updates test methods to validate new token refresh behavior and error response codes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…tCredentialsAccessTokenBuilder.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lacc
lacc merged commit 74ac76b into main Aug 29, 2025
4 checks passed
@lacc
lacc deleted the clientCredentialsRefreshToken branch August 29, 2025 16:30
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.

2 participants