Beta

Create a tenant

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

Issuer, audience, and authorized party

The issuer and audience checks look like simple string comparisons. What matters is what the collage app compares against, and how a near match or an extra audience can let in a token that was never meant for it.

Matching the issuer

Providers and relying parties said that everything a relying party trusts about the photo service hangs from one value, its issuer. A relying party also has to refuse an ID token that was issued to some other client. Both are kept by comparisons that look trivial, one string against another. All domains, identifiers and tokens in these examples are fictional.

The collage app compares iss with the issuer stored in the pending attempt, https://auth.photos.example, character for character. The comparison is case-sensitive and makes no adjustments, so each of these fails:

https://auth.photos.example/         trailing slash
https://Auth.Photos.Example          different case
http://auth.photos.example           not https
https://auth.photos.example/test     different path

Some of these would reach the same web server, and that is beside the point. An issuer identifier is a name compared as text, not an address to be tidied up before use. It is also the namespace for every sub the provider issues, so a relying party that let near matches through would have to decide which of them are really the same provider, and an attacker would only need one it decided wrongly.

The path is part of the name. OpenID Connect allows several issuers on one host, told apart by path, and treats them as unrelated providers. As Providers and relying parties mentioned, services that host sign-in for many organizations often give each organization its own issuer this way:

https://id.workplace.example/org-7731     one company's issuer
https://id.workplace.example/org-9020     another company's issuer

A service like this often signs every organization's tokens with the same keys. A valid signature then shows that the service issued the token, not which organization it speaks for. Only iss says that. Now imagine a relying party that serves several business customers on this service and, to avoid configuring each one, accepts any issuer beginning with https://id.workplace.example/. It accepts tokens from every organization on the service, including one an attacker can create in a few minutes. In their own organization the attacker controls the directory and can create a user with any name and email address. If the relying party finds accounts by email address, or by sub without its issuer, that user signs in as somebody else.

The safe arrangement lists each accepted issuer exactly. An application that really does welcome any organization on such a service treats each issuer as a separate provider. It stores the issuer with every account link, and never lets a token from one organization sign in to an account linked through another. Supporting several providers returns to keeping providers apart.

Where the expected value comes from matters as much as the comparison. The collage app took https://auth.photos.example from its own configuration when Ava selected Continue with your photo account, and stored it with the attempt. It never takes the expected issuer from the token being checked, which would only compare the token with itself. At the callback, the collage app compared the iss response parameter with the same stored value before it sent the code anywhere. The ID token's iss repeats that comparison on a value the provider signed. Provider discovery shows where the configured issuer and its key set come from.

Checking the audience

Moments after signing in to the collage app, Ava also signed in to the printer with her photo account. The photo service, which knows the printer as the client photo-printer, relied on the session she had just started, asked her nothing, and issued the printer an ID token about her. Decoded, the claims that matter here read:

{
  "iss": "https://auth.photos.example",
  "sub": "user-2048",
  "aud": "photo-printer",
  "exp": 1790845520,
  "iat": 1790845220
}

Everything about it is genuine. The photo service signed it with photos-rs-2026-09, its issuer is right, it names Ava, and it has almost five minutes left to run. If it reached the collage app, its signature would verify there too. Only aud shows that it was issued to someone else.

In the collage app's website sign-in, a token issued to another client has no easy way in. The collage app validates only tokens from its own token requests, and the photo service redeems only codes that were issued to the collage app. ID tokens travel other routes, though.

Suppose the collage company adds a phone app that runs the sign-in itself and passes what it received to the collage app's backend. With OpenID Connect, the app passes its ID token, and the backend checks that the token is addressed to the phone app, a client the collage company registered itself. If the printer's operator, or anyone who copied a token from the printer, sent the backend this token instead, the audience check is what refuses it. Older flows that return ID tokens through the browser, covered in Response types, response modes, and older flows, offer still more routes. The audience check is the one that works on all of them.

The claim comes in two forms. With one audience it is usually a plain string. In general it is an array:

"aud": "photo-collage"
"aud": ["photo-collage"]
"aud": ["photo-collage", "photo-printer"]

The collage app accepts the first two, which say the same thing. The third contains photo-collage, but the specification requires the collage app to reject it anyway, because it lists an audience the collage app does not trust. Every party named in aud was meant to receive the same token, and any of them could present it to another. A token addressed to both could come from the printer as easily as from the collage app's own exchange, and nothing in it would show which. An extra audience is acceptable only when the collage app has a reason to trust it, such as another registration of its own, and then the collage app lists that value in its configuration rather than accepting whatever appears.

The client ID is compared exactly, like the issuer. Photo-Collage is a different client.

Stored with the attempt

iss
https://auth.photos.example
aud
photo-collage
azp
absent, or photo-collage

Every token here is genuine and correctly signed

One value differs in each

  • aud "photo-collage"
  • aud ["photo-collage"]
  • iss https://auth.photos.example/
  • aud "photo-printer"
  • aud ["photo-collage", "photo-printer"]
  • azp "photo-printer"

Only aud shows that it was issued to someone else.

Correctly signed tokens offered to the collage app, and the one value in each that decides whether it accepts them.

The authorized party

azp, the authorized party, names the client that an ID token was issued to. It was meant for tokens whose audience is not simply the client that asked for them: a single audience that differs from the requesting client, or several audiences, where aud alone cannot say which of them asked for the sign-in.

In practice it appears with arrangements that go beyond the core specification. Some providers offer a variation on the phone app design above: when one company registers several clients for one product, its phone app can ask for an ID token meant for its web backend. That token's aud names the backend's client ID, and its azp names the phone app, the client that requested it. The backend checks that it is the audience and that the authorized party is one of its own clients. What those values mean, and when they appear, is defined by the provider's documentation.

The current text of OpenID Connect notes that azp otherwise rarely occurs, and encourages relying parties that use no such arrangement to ignore it. Its validation steps also permit the original rule, which many libraries still apply: when azp is present, it must equal the relying party's own client ID.

The collage app uses no such arrangement, and the photo service's tokens for it carry no azp. Ignoring the claim and applying the original rule lead to the same result for every token the photo service should be sending. The difference appears only if something unexpected arrives, and a token that names a different client as the party it was issued to is not one the collage app asked for. So the collage app rejects it, and keeps the rule switched on in its library.

The issuer and audience settle whose statement this is and whom it is for. They say nothing about when it was made, or which sign-in attempt it answers.

Check your understanding

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

A hosted sign-in service gives each organization its own issuer on one host and signs every organization's tokens with the same keys. Why is accepting any issuer that starts with the service's address dangerous? 1 of 3

Choose one answer.

An ID token with a valid signature and the right issuer carries "aud": ["photo-collage", "photo-printer"]. The collage app trusts no audience except photo-collage. What should it do? 2 of 3

Choose one answer.

The collage app uses no arrangement involving several clients, and its library applies the original azp rule. An ID token arrives with a valid signature, the right issuer, "aud": "photo-collage" and "azp": "photo-printer". What should the collage app do? 3 of 3

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