Commit b299e3b
* Deprecate decode_id_token and stop validating ID tokens (#911)
MSAL should not perform any ID token validation. Per OpenID Connect, an ID
token obtained via direct communication with the token endpoint (how MSAL
retrieves tokens) does not need client-side validation, and MSAL does not
manage sessions, so it should not check exp/iss/aud.
- Add non-validating _decode_id_token_claims() and use it on the retrieval
path (Client._obtain_token and TokenCache) so no iss/aud/exp/nbf checks run
- Deprecate the public decode_id_token() function and Client.decode_id_token()
method with a DeprecationWarning
- Keep nonce and max_age/auth_time auth-code-flow replay protections
- Update docstrings that claimed the SDK validates the ID token
- Update tests accordingly
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Clarify deprecation wording and add stacklevel to warning (PR #943 review)
- Add stacklevel=2 so the DeprecationWarning points at the caller's site
- Reword warning and docstrings to avoid implying this legacy helper is
non-validating; clarify that only token acquisition stopped validating
while decode_id_token() still performs legacy validation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent d81a29a commit b299e3b
3 files changed
Lines changed: 75 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
77 | 95 | | |
78 | 96 | | |
79 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
80 | 107 | | |
81 | 108 | | |
82 | 109 | | |
83 | 110 | | |
84 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
85 | 118 | | |
86 | 119 | | |
87 | 120 | | |
| |||
157 | 190 | | |
158 | 191 | | |
159 | 192 | | |
160 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
164 | 203 | | |
165 | 204 | | |
166 | 205 | | |
167 | | - | |
| 206 | + | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
171 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
172 | 214 | | |
173 | 215 | | |
174 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
95 | 109 | | |
0 commit comments