@stonyx/oauth 0.1.1-alpha.28 → 0.1.1-alpha.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,13 +87,24 @@ export default class AuthRequest extends Request {
87
87
  // goes in the URL instead is a single-use 60-second ticket that
88
88
  // authenticates nothing, redeemed at `POST /auth/session` (#45).
89
89
  //
90
- // `expiresAt` stays: it is not a credential and nothing
91
- // authenticates from it.
90
+ // The ticket rides in the *fragment*, not the query. A fragment is
91
+ // never transmitted to any server by any user agent: it is absent
92
+ // from the frontend's own access logs, from every reverse proxy
93
+ // and CDN in front of the landing page, and from `Referer` under
94
+ // every referrer policy. That removes two of the four leak vectors
95
+ // #45 names outright, for one character. What it does not remove
96
+ // is browser history and readability by page scripts — those are
97
+ // why the ticket is still single-use and 60-second, and why the
98
+ // documented migration scrubs it with `history.replaceState`.
99
+ //
100
+ // `expiresAt` rides along in the same fragment rather than staying
101
+ // in the query, so the consumer has one place to read from.
102
+ // It is not a credential and nothing authenticates from it.
92
103
  const params = new URLSearchParams({
93
104
  ticket: this.oauth.issueExchangeTicket(session),
94
105
  expiresAt: String(session.expiresAt),
95
106
  });
96
- state.redirect = `${this.oauth.frontendCallbackUrl}?${params}`;
107
+ state.redirect = `${this.oauth.frontendCallbackUrl}#${params}`;
97
108
  return;
98
109
  }
99
110
  // No `frontendCallbackUrl` configured: the session is the response
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.1.1-alpha.28",
7
+ "version": "0.1.1-alpha.29",
8
8
  "description": "OAuth2 authentication module for the Stonyx framework",
9
9
  "repository": {
10
10
  "type": "git",
@@ -173,13 +173,24 @@ export default class AuthRequest extends Request {
173
173
  // goes in the URL instead is a single-use 60-second ticket that
174
174
  // authenticates nothing, redeemed at `POST /auth/session` (#45).
175
175
  //
176
- // `expiresAt` stays: it is not a credential and nothing
177
- // authenticates from it.
176
+ // The ticket rides in the *fragment*, not the query. A fragment is
177
+ // never transmitted to any server by any user agent: it is absent
178
+ // from the frontend's own access logs, from every reverse proxy
179
+ // and CDN in front of the landing page, and from `Referer` under
180
+ // every referrer policy. That removes two of the four leak vectors
181
+ // #45 names outright, for one character. What it does not remove
182
+ // is browser history and readability by page scripts — those are
183
+ // why the ticket is still single-use and 60-second, and why the
184
+ // documented migration scrubs it with `history.replaceState`.
185
+ //
186
+ // `expiresAt` rides along in the same fragment rather than staying
187
+ // in the query, so the consumer has one place to read from.
188
+ // It is not a credential and nothing authenticates from it.
178
189
  const params = new URLSearchParams({
179
190
  ticket: this.oauth.issueExchangeTicket(session),
180
191
  expiresAt: String(session.expiresAt),
181
192
  });
182
- state.redirect = `${this.oauth.frontendCallbackUrl}?${params}`;
193
+ state.redirect = `${this.oauth.frontendCallbackUrl}#${params}`;
183
194
  return;
184
195
  }
185
196