Skip to content

fix: automatically include offline_access as a scope in the Azure provider to enable automatic token refreshing#3001

Merged
jlowin merged 4 commits intoPrefectHQ:mainfrom
JonasKs:azure-offline-token
Jan 29, 2026
Merged

fix: automatically include offline_access as a scope in the Azure provider to enable automatic token refreshing#3001
jlowin merged 4 commits intoPrefectHQ:mainfrom
JonasKs:azure-offline-token

Conversation

@JonasKs
Copy link
Copy Markdown
Contributor

@JonasKs JonasKs commented Jan 26, 2026

Add documentation to the Azure provider: We recommend always sending offline_access as an additional_authorize_scopes. This enable FastMCP to automatically refresh all tokens.

Contributors Checklist

Review Checklist

  • I have self-reviewed my changes
  • My Pull Request is ready for review

Closes #2628

@marvin-context-protocol marvin-context-protocol Bot added documentation Updates to docs, examples, or guides. Primary change is documentation-related. auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. enhancement Improvement to existing functionality. For issues and smaller PR improvements. labels Jan 26, 2026
@JonasKs JonasKs force-pushed the azure-offline-token branch from 22384a7 to 30b8867 Compare January 26, 2026 12:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 26, 2026

Walkthrough

The Azure provider now coerces additional_authorize_scopes to a list, stores it as a list, and automatically appends "offline_access" if not already present. Documentation examples were updated to remove offline_access from user-specified scopes and a note was added that offline_access is automatically included to obtain refresh tokens. No public function signatures or external API surfaces were changed.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the primary change: automatically including offline_access in the Azure provider to enable automatic token refreshing.
Description check ✅ Passed The PR description follows the template with all required sections completed, including contributors and review checklists, linked issues (#3000 and #2628), and clear explanation of the changes.
Linked Issues check ✅ Passed The code changes align with linked issues: automatically appending offline_access scope (#3000) and documentation/implementation enables token refresh to prevent re-authentication (#2628).
Out of Scope Changes check ✅ Passed All changes are directly related to the objectives: Azure provider documentation updates, automatic offline_access inclusion, and supporting configuration handling, with no extraneous modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JonasKs JonasKs changed the title docs: recommend offline_access as a scope to enable automatic token refreshing docs: recommend offline_access as a scope in the Azure provider to enable automatic token refreshing Jan 26, 2026
@jlowin
Copy link
Copy Markdown
Member

jlowin commented Jan 26, 2026

@JonasKs this seems to be such a common stumbling block I'm wondering if we should make it a default scope for the azure provider, which users could remove by providing a custom set? For example this would close #2628 (edited your description to attach it)

@JonasKs
Copy link
Copy Markdown
Contributor Author

JonasKs commented Jan 26, 2026

@jlowin , agree. I can fix tomorrowWednesday!

@JonasKs JonasKs changed the title docs: recommend offline_access as a scope in the Azure provider to enable automatic token refreshing fix: automatically include offline_access as a scope in the Azure provider to enable automatic token refreshing Jan 29, 2026
@JonasKs
Copy link
Copy Markdown
Contributor Author

JonasKs commented Jan 29, 2026

@jlowin this is ready for review, and I've rebased main into this branch.

@JonasKs JonasKs force-pushed the azure-offline-token branch from 00f4968 to 060826a Compare January 29, 2026 08:52
@jlowin
Copy link
Copy Markdown
Member

jlowin commented Jan 29, 2026

Thank you!

@jlowin jlowin merged commit 8b30108 into PrefectHQ:main Jan 29, 2026
7 checks passed
gfortaine pushed a commit to gfortaine/fastmcp that referenced this pull request Feb 4, 2026
…vider to enable automatic token refreshing (PrefectHQ#3001)

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Related to authentication (Bearer, JWT, OAuth, WorkOS) for client or server. documentation Updates to docs, examples, or guides. Primary change is documentation-related. enhancement Improvement to existing functionality. For issues and smaller PR improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document offline_access setting for Azure Re-authentication is occasionally required when using MCP.

2 participants