-
Notifications
You must be signed in to change notification settings - Fork 698
Description
Recently, a new OAuth response parameter was defined in RFC 9207: iss
The basic idea is that if a server advertises authorization_response_iss_parameter_supported as true in its metadata (or we know of support via explicit configuration), the client should only accept the response if iss matches the server's issuer identifier.
Furthermore: This Client clears several OAuth/OpenID response parameters after login (e.g. code or state).
The following code should clear iss as well:
angular-oauth2-oidc/projects/lib/src/oauth-service.ts
Lines 1743 to 1761 in d95d7da
| if (!options.preventClearHashAfterLogin) { | |
| const href = | |
| location.origin + | |
| location.pathname + | |
| location.search | |
| .replace(/code=[^&\$]*/, '') | |
| .replace(/scope=[^&\$]*/, '') | |
| .replace(/state=[^&\$]*/, '') | |
| .replace(/session_state=[^&\$]*/, '') | |
| .replace(/^\?&/, '?') | |
| .replace(/&$/, '') | |
| .replace(/^\?$/, '') | |
| .replace(/&+/g, '&') | |
| .replace(/\?&/, '?') | |
| .replace(/\?$/, '') + | |
| location.hash; | |
| history.replaceState(null, window.name, href); | |
| } |
At a minimum, this should free sites of having to manually clear the iss when using compliant servers. When properly implemented, some sites might even benefit from the mix-up countermeasure.