Skip to content

Standardize 401 problem detail URLs with recoverable/unrecoverable categories#3003

Merged
jonathangreen merged 1 commit intomainfrom
chore/standardize-401-problem-detail-urls
Jan 23, 2026
Merged

Standardize 401 problem detail URLs with recoverable/unrecoverable categories#3003
jonathangreen merged 1 commit intomainfrom
chore/standardize-401-problem-detail-urls

Conversation

@jonathangreen
Copy link
Member

Description

Update all 401 authentication error URLs to use a new categorization scheme that helps mobile clients determine how to handle each error:

  • recoverable: client should automatically trigger re-authentication
  • unrecoverable: client should display the error to the user

New URL pattern: http://palaceproject.io/terms/problem/auth/{category}/{auth-type}/{error}

Recoverable errors (6)

Client should retry auth flow:

Error New URL
PATRON_AUTH_ACCESS_TOKEN_EXPIRED .../auth/recoverable/token/expired
PATRON_AUTH_ACCESS_TOKEN_INVALID .../auth/recoverable/token/invalid
INVALID_SAML_BEARER_TOKEN .../auth/recoverable/saml/bearer-token-invalid
SAML_AUTHENTICATION_ERROR .../auth/recoverable/saml/authentication-failed
SAML_INVALID_RESPONSE .../auth/recoverable/saml/invalid-response
SAML_TOKEN_EXPIRED .../auth/recoverable/saml/session-expired

Unrecoverable errors (4)

Client should display error to user:

Error New URL
INVALID_CREDENTIALS .../auth/unrecoverable/credentials/invalid
SAML_NO_ACCESS_ERROR .../auth/unrecoverable/saml/no-access
SAML_INVALID_REQUEST .../auth/unrecoverable/saml/invalid-request
SAML_CANNOT_DETERMINE_PATRON .../auth/unrecoverable/saml/cannot-identify-patron

Motivation and Context

This change enables mobile clients to distinguish between 401 errors that require re-authentication versus those that need to be displayed to the user, without having to track URLs over redirects or compare domains.

See Slack discussion: https://lyrasis.slack.com/archives/CCY3PH8JD/p1769101265956669

How Has This Been Tested?

  • Existing tests pass (tests compare against problem detail objects, not URL strings directly)

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

…tegories

Update all 401 authentication error URLs to use a new categorization scheme
that helps mobile clients determine how to handle each error:

- recoverable: client should automatically trigger re-authentication
- unrecoverable: client should display the error to the user

New URL pattern: http://palaceproject.io/terms/problem/auth/{category}/{auth-type}/{error}

Recoverable errors (6):
- PATRON_AUTH_ACCESS_TOKEN_EXPIRED
- PATRON_AUTH_ACCESS_TOKEN_INVALID
- INVALID_SAML_BEARER_TOKEN
- SAML_AUTHENTICATION_ERROR
- SAML_INVALID_RESPONSE
- SAML_TOKEN_EXPIRED

Unrecoverable errors (4):
- INVALID_CREDENTIALS
- SAML_NO_ACCESS_ERROR
- SAML_INVALID_REQUEST
- SAML_CANNOT_DETERMINE_PATRON
@jonathangreen jonathangreen requested a review from a team January 22, 2026 21:21
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.97%. Comparing base (1676f62) to head (f79b24a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3003   +/-   ##
=======================================
  Coverage   92.97%   92.97%           
=======================================
  Files         459      459           
  Lines       43276    43276           
  Branches     6034     6034           
=======================================
  Hits        40238    40238           
  Misses       1966     1966           
  Partials     1072     1072           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

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

Looks good! 🥇

@jonathangreen jonathangreen merged commit 9b3fd4b into main Jan 23, 2026
19 checks passed
@jonathangreen jonathangreen deleted the chore/standardize-401-problem-detail-urls branch January 23, 2026 14:55
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