Skip to content

Fix oauth refresh#955

Open
jpagh wants to merge 5 commits into
jhpyle:masterfrom
jpagh:fix-oauth-refresh
Open

Fix oauth refresh#955
jpagh wants to merge 5 commits into
jhpyle:masterfrom
jpagh:fix-oauth-refresh

Conversation

@jpagh
Copy link
Copy Markdown
Contributor

@jpagh jpagh commented May 12, 2026

Fixes #954

Adds the following which are things that I needed that I think others would benefit from having included, but that don't change any default behaviors:

extra_auth_args (dict): Additional keyword arguments to pass to the
    OAuth authorization URL.
url_style_short (bool): If true, use the short interview URL style for
    OAuth redirect URIs. Defaults to false.

Copilot AI review requested due to automatic review settings May 12, 2026 16:31
Copy link
Copy Markdown

Copilot AI left a comment

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 addresses OAuth credential refresh reliability for DAOAuth by ensuring Redis-loaded credentials are reattached to storage, silently refreshed when expired and refreshable, and treated as unauthorized when expired and not refreshable. It also adds opt-in configuration knobs to customize authorization URL parameters and the redirect URL style without changing defaults.

Changes:

  • Add DAOAuth options extra_auth_args (extra authorization_url() kwargs) and url_style_short (use short-style interview URLs for redirect URIs).
  • Refresh expired stored credentials in DAOAuth.get_credentials() (via _get_stored_credentials(refresh=True)) and treat expired tokens as unauthorized when refresh is unavailable/fails.
  • Reattach Redis storage to credentials reloaded from JSON so refreshed tokens can be persisted.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docassemble_base/docassemble/base/util.py
Comment thread docassemble_base/docassemble/base/util.py Outdated
Comment thread docassemble_base/docassemble/base/util.py
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.

DAOAuth credential refresh doesn't work properly

2 participants