1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! The client an ID token was issued to, from its `aud` and `azp` claims: the one rule that
//! the server, the owner's client and the CLI apply (OpenID Connect Core 1.0, section
//! 3.1.3.7, items 3 to 5). It lives here because this is the only crate both sides link.
//!
//! - `aud` is a string or an array of strings; anything else is refused.
//! - The client id must be a member of `aud` and be accepted.
//! - When `aud` has more than one member, `azp` must be present.
//! - When `azp` is present, whatever `aud` holds, it is the client id: it must be a member
//! of `aud` and be accepted. When several members of `aud` are accepted, `azp` decides.
//!
//! The other members of `aud` are not checked. With `azp` equal to the client id, the issuer
//! issued the token to that client; an issuer such as Zitadel lists every application of a
//! project in `aud`. Without the `azp` rule, a token minted for another application of the
//! same project, which also holds this client id in `aud`, would pass.
/// An `aud` or `azp` claim as the caller read it from the token's JSON.
/// The client id the token was issued to, when `accepted` takes it; `None` refuses the
/// token.