Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Checking the response issuer

Since the printer added Pixel Vault as a second photo service, its callback receives responses from two authorization servers, and in plain OAuth 2.0 those responses look alike. Issuer identification has the server name itself in every response and the client compare that name with the server it asked, and each half has details that are easy to get wrong.

A response that names its sender

Each response to the printer's callback carries a code and the state the printer sent, and nothing in plain OAuth 2.0 says which service issued the code, so the printer has to rely on its own record of which service Ava chose. Authorization server mix-up showed how an attacker exploits that reliance and compared the defenses against it. The one current guidance prefers has two halves: the server names itself, and the client checks the name.

OAuth 2.0 Authorization Server Issuer Identification, published as RFC 9207 in 2022, adds one parameter to the authorization response. A server that supports it must include iss in every authorization response it sends, successes and errors alike.

All domains, identifiers, and codes in these examples are fictional. The Redirects and authorization codes lesson showed the parameter in the printer's first callback, and Errors and denied access showed it on a denial:

Success:
https://printer.example/oauth/callback
  ?code=demo-code-7
  &state=demo-attempt-7
  &iss=https%3A%2F%2Fauth.photos.example

Error:
https://printer.example/oauth/callback
  ?error=access_denied
  &state=demo-attempt-7
  &iss=https%3A%2F%2Fauth.photos.example

The value is form-encoded because it sits inside a URL. Decoded, it reads https://auth.photos.example. Errors carry it for the same reason successes do: an error is a message from a server, and the printer should know which server sent it before acting on it.

A response from Pixel Vault, if Pixel Vault supported the parameter, would carry iss=https%3A%2F%2Fauth.pixelvault.example instead. Two responses that were indistinguishable now name their senders.

The issuer identifier

The value of iss is not chosen for this parameter. It is the authorization server's issuer identifier, the name the server uses for itself throughout OAuth. An issuer identifier is a URL that uses HTTPS and has no query or fragment. It can include a path, which lets one host run several authorization servers, for example https://login.example/east and https://login.example/west, each with its own identifier, endpoints, and keys.

This value has appeared in earlier lessons. It is the iss claim in the JWT access tokens the photo service issues, the aud the printer puts in its signed client assertions and request objects, and the iss claim in a JARM response. It is also the issuer value in the server's metadata document, and the specification requires the iss response parameter to be identical to that value.

An issuer identifier names a whole configuration, not just a host. Behind https://auth.photos.example stand a particular authorization endpoint, token endpoint, and key set. That is what makes the parameter useful: once the printer knows which issuer answered, it knows which token endpoint the code belongs at, and whether that is the one it intended to use.

Advertising support

A server that supports the parameter says so in its metadata, the document it publishes at a well-known address derived from its issuer identifier. The photo service's document, shortened to the fields that matter here, includes:

{
  "issuer": "https://auth.photos.example",
  "authorization_endpoint": "https://auth.photos.example/authorize",
  "token_endpoint": "https://auth.photos.example/token",
  "authorization_response_iss_parameter_supported": true
}

authorization_response_iss_parameter_supported set to true promises that every authorization response will carry iss. When the field is omitted, its value is false. Pixel Vault's metadata omits it, because Pixel Vault has not adopted the parameter.

The flag matters because of what it lets a client conclude from silence. A response without iss from Pixel Vault is normal. The same response claiming to come from the photo service is not, because the photo service has promised to include it.

Adding the parameter does not break older clients, because the original OAuth 2.0 specification requires clients to ignore response parameters they do not recognize. Servers that publish no metadata at all can still support it, with the issuer identifier and the promise agreed with each client developer and configured in the client directly. Authorization server metadata, later in Advanced OAuth, explains how clients fetch and validate documents like this one.

Remembering who was asked

Supporting the parameter is the server's half of the arrangement. The client's half is knowing which issuer it expected and comparing the value correctly, and most mistakes happen there. The printer keeps a configuration record for each authorization server it works with, built from that server's metadata:

Photo service
  Issuer:          https://auth.photos.example
  Token endpoint:  https://auth.photos.example/token
  Client ID:       photo-printer
  Sends iss:       yes, advertised in its metadata

Pixel Vault
  Issuer:          https://auth.pixelvault.example
  Token endpoint:  https://auth.pixelvault.example/oauth/token
  Client ID:       8f3c21e9-6b4d-4a1f-9e2c-5d07b8a4c613
  Sends iss:       no, not advertised

When Ava chooses a service and selects Connect, the printer records that service's issuer identifier in the pending transaction, as Correlating requests and responses showed. It records the issuer rather than the address of the authorization endpoint it sent Ava's browser to, because the issuer is what ties the attempt to the token endpoint the code must eventually go to.

The records must also stay distinct. Two configured servers must never share an issuer identifier. If an administrator could add a server by hand and type the photo service's issuer into a record that points at someone else's token endpoint, the issuer check would pass for the wrong server. A client that allows manual configuration must refuse a duplicate.

Comparing the value

The printer reads iss from the callback, decodes it once from its form encoding, and compares the result with the issuer in the pending transaction using simple string comparison: the two strings must be identical, character for character. No normalization is applied, so values that a browser might treat as the same address do not match:

Decoded iss values compared with the photo service's issuer identifier
Decoded issCompared with https://auth.photos.example
https://auth.photos.exampleMatch.
https://auth.photos.example/No match. The trailing slash makes a different string.
https://AUTH.photos.exampleNo match, although host names are not case-sensitive.
https://auth.photos.example:443No match, although 443 is the default port for HTTPS.
https://auth.pixelvault.exampleNo match. A different server answered.

Strictness costs the photo service nothing, because it is required to send exactly its own identifier every time. Leniency, on the other hand, would cost the printer something. Libraries normalize URLs differently, and every rule that treats two strings as equal is a rule an attacker can look for a way to exploit. The same goes for decoding: the value is decoded once, and a printer that decoded it a second time could turn a carefully encoded string into one that matches.

A small function captures the check:

function checkIssuer(callback: URLSearchParams, pending: PendingAttempt): void {
  const server = pending.server;          // configuration recorded when the attempt began
  const received = callback.get('iss');   // URLSearchParams has already decoded it once

  if (received === null) {
    if (server.sendsIss) throw new CallbackRejected('missing_iss');
    return;                                // allowed only with another mix-up defense
  }
  if (!server.sendsIss) throw new CallbackRejected('unexpected_iss');
  if (received !== server.issuer) throw new CallbackRejected('issuer_mismatch');
}

The received value is only ever compared. It is never used to look up a configuration, choose a token endpoint, or fetch metadata. If the printer let the response tell it which server had answered, an attacker would simply tell it.

When iss is missing or unexpected

The function handles four situations:

What the printer does for each combination of response and expected server
The responseThe expected serverThe printer
Carries the expected issSends issContinues with its other checks, such as state.
Carries a different issAnyRejects the response and does not use the code.
Carries no issSends issRejects the response. The parameter's absence is itself a warning.
Carries no issDoes not send issAccepts it only if local policy allows this server and another mix-up defense covers it.

The awkward case is a response that carries iss from a server that never advertised support. The specification says clients should discard such responses, while acknowledging that some legitimate servers send the parameter without advertising it. The printer's function rejects them. A client that knows a particular server behaves this way can record that in its configuration and treat the server as one that sends iss.

Error responses get the same treatment. A callback carrying error=access_denied with an unexpected issuer, or with no issuer from a server that always sends one, is not evidence that the expected service refused anything. The printer should not tell Ava that Pixel Vault declined the connection on the strength of a message Pixel Vault may not have sent. It reports that the connection could not be completed and offers to start again.

OpenID Connect adds one more rule. When an ID token, the sign-in token OpenID Connect defines, comes back from the authorization endpoint in the same response, the iss parameter must be identical to the iss claim inside it.

A rejected issuer is worth recording carefully. The printer logs the stage, the reason, such as issuer_mismatch, the expected issuer, and the attempt's correlation ID, without the code. An occasional mismatch may be noise. A sudden run of them is either an attack in progress or a configuration change somewhere, and both deserve someone's attention quickly.

What the issuer check covers

With the check in place, a mix-up ends at the printer's callback, before the code goes anywhere. Look at which server made that work. It was the photo service, the honest server, that put its name in the response. The attacker controls Pixel Vault's configuration, including whether Pixel Vault claims to send iss. If the photo service did not send the parameter, its response would arrive without one, the attacker would make sure Pixel Vault also claimed not to send it, and the printer would see nothing unusual. The check reliably protects codes from servers that send iss. A server that does not send it needs another defense for its own codes.

Several things lie outside the check altogether.

The response's integrity. The iss parameter is unsigned text, and that is acceptable for this purpose. In a mix-up, the response travels from the honest server through Ava's browser without the attacker touching it. An attacker who could rewrite it in transit would already have the code and would not need a mix-up at all. Signing the whole response, as JARM does, serves other goals, and its iss claim is compared under the same rules as the parameter.

Whose code it is. The parameter says which server issued a code, not which account or browser session it belongs to. An attacker's own genuine photo service code carries exactly the right iss. Injected codes and forged callbacks are stopped by state and PKCE, as the Code interception and injection and the Request correlation and CSRF lessons described.

The printer's own records. The comparison is only as good as the expected value, which is why two configured servers must never share an issuer identifier. Metadata needs the same care: if the printer accepted a document in which Pixel Vault claimed the photo service's identifier, the check would pass for the wrong server. Metadata validation prevents that, because a metadata document's issuer must equal the identifier used to locate it.

Servers without issuer identification

Pixel Vault does not send iss, so its codes need protection that does not depend on the parameter. Two signed alternatives carry an issuer inside the response: a JARM response, and in OpenID Connect sign-in flows, an ID token returned from the authorization endpoint. Either is checked the same way as the parameter. Where neither is available, the fallback is a distinct return address for each server, the defense Authorization server mix-up compared with the others, and current guidance says to use it only then.

The printer does not have to pick one defense for every server. It keeps the issuer check for the photo service, which sends iss, and gives Pixel Vault a return address of its own. Each pending transaction records the expected issuer, and through it which check applies: iss must be present and match for the photo service, and a Pixel Vault response must arrive at Pixel Vault's address.

The arrangement should not outlive its reason. When Pixel Vault adopts the parameter and says so in its metadata, the printer updates its record and starts requiring iss from Pixel Vault too.

When a legitimate response fails the check

Most issuer rejections in practice involve no attacker at all. They come from configuration that has drifted away from what a server actually sends:

Configuration drift that makes a legitimate response fail the issuer check
SituationWhat the printer sees
A typing error in a manually configured issuer, such as a trailing slashEvery response from that server fails with an issuer mismatch.
The test website configured with the production issuer, or the reverseMismatches only in one environment.
A server begins sending iss after the printer last read its metadataResponses carrying an iss the printer did not expect, which its strict check rejects.
A server moves to a new issuer identifierEvery response fails until the printer's configuration changes.

The fix in each case is to correct the configuration: refresh metadata on a schedule, compare configured issuers with each server's published issuer value when deploying, and keep test and production records apart. A change of issuer identifier is a migration that a server must announce to its clients, because the identifier is meant to be stable.

What the printer must not do is loosen the check to make the errors go away, by accepting any issuer for a while, normalizing values until they match, or adopting whatever issuer a response presents. A mismatch means either an attack or a mistake, and from inside one callback the two look identical. In both cases the safe outcome is the same: the code goes unused, Ava is asked to try again, and someone fixes whatever made the values differ.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

The pending attempt expects https://auth.photos.example, and the callback's decoded iss is https://auth.photos.example/ with a trailing slash. What should the printer do? 1 of 4

Choose one answer.

A callback carries an iss naming a server the printer did not expect. What should the printer do with that value? 2 of 4

Choose one answer.

The photo service's metadata sets authorization_response_iss_parameter_supported to true. A callback for a photo service attempt arrives with a code and a matching state, but no iss. What should the printer do? 3 of 4

Choose one answer.

Pixel Vault does not send iss and offers no signed responses. The printer already checks iss on every photo service response. How should it protect codes from Pixel Vault? 4 of 4

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity