Skip to content

Remove ?auth_token= URL auth path; header + demo-scoped session only - #265

Merged
aaronjae22 merged 11 commits into
mainfrom
aaronaej/optional-oauth2-auth-review
Jun 16, 2026
Merged

Remove ?auth_token= URL auth path; header + demo-scoped session only#265
aaronjae22 merged 11 commits into
mainfrom
aaronaej/optional-oauth2-auth-review

Conversation

@aaronjae22

Copy link
Copy Markdown
Collaborator

Closes #264

This PR completely reviews OptionalOAuth2Authentication.

The auth class now accepts a portability token two ways:

  1. The normative Authorization: Bearer header
  2. Demo-only session-stored token — and the leak-prone ?auth_token= query-string path is removed entirely.

For testing (and demoing) purposes I previously created a third auth path that included ?auth_token= in the URLs. With this update, the session path already covers the demo without that exposure.

I deleted _authenticate_with_url_token. The session path stays but is demo-scoped by construction (only the demo flow populates the session; cookie-bound; re-validated each request; ?public_only-suppressed), so it needs no flag or config. The token-validation step is kept as _resolve_valid_access_token. The demo oauth_token_exchange.html authenticates via session (no token in any URL).

@aaronjae22
aaronjae22 requested a review from lisad June 14, 2026 22:32
@aaronjae22 aaronjae22 self-assigned this Jun 14, 2026

#### 2. URL Parameter (Testing)
```http
GET /api/actors/1/?auth_token=your-oauth-token-here HTTP/1.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this was harmful in a testbed and needed to be removed, but I also don't think it's harmful to remove

Base automatically changed from aaronaej/implement-demo-side-for-authorization-redirect-includes-activitypub_actor to main June 16, 2026 20:07
@aaronjae22
aaronjae22 marked this pull request as ready for review June 16, 2026 20:11
@aaronjae22
aaronjae22 merged commit 0fc6fe1 into main Jun 16, 2026
3 checks passed
@aaronjae22
aaronjae22 deleted the aaronaej/optional-oauth2-auth-review branch June 16, 2026 20:35
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.

Environment-scope OptionalOAuth2Authentication non-header paths

2 participants