Skip to content

Implement RFC 9207 #1213

@bellebaum

Description

@bellebaum

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestImprovements and additions to the library.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions