Issuer, audience, and authorized party
The issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. 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 tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. that was never meant for it.
Matching the issuer
Providers and relying parties said that everything a relying partyAn application that accepts and relies on a sign-in from another service, the name used in OpenID Connect and for passkeys. SAML calls the same role a service provider. trusts about the photo service hangs from one value, its issuer. A relying party also has to refuse an ID tokenIn OpenID Connect, a signed JWT from the provider, addressed to one client, saying which account authenticated, when, and in answer to which request. It reports a sign-in and is not used to call APIs. 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 pathSome 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 ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange. 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 issuerA service like this often signs every organization's tokens with the same keys. A valid signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message. 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 setA JSON document, published at a fixed HTTPS address, that lists an issuer's current public keys so others can verify its signatures. It never contains private keys. 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 sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. 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.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Refuse near-miss issuers, another client's token and an extra audienceGive lab-collage its own ID token manager, reject near-match issuers and a genuine token issued to the printer, then add a second audience and decide deliberately whether to trust it.