File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 9
9
runs-on : ubuntu-latest
10
10
strategy :
11
11
matrix :
12
- python-version : [3.8, 3.9]
13
- fail-fast : false
12
+ python-version : [3.9]
14
13
15
14
steps :
16
15
- uses : actions/checkout@v2
Original file line number Diff line number Diff line change @@ -239,15 +239,15 @@ def authenticate_user(
239
239
},
240
240
)
241
241
242
- if self . client_id is not None :
243
- token_audience = id_token ["aud" ]
244
- if "azp" in id_token :
245
- if id_token [ "azp" ] != self . client_id :
246
- raise JWTError (
247
- f"""Invalid authorized party "azp": { id_token [ "azp" ] } """
248
- )
249
- elif type ( token_audience ) == list and len ( token_audience ) >= 1 :
250
- raise JWTError ( 'Missing authorized party "azp" in IDToken' )
242
+ if (
243
+ type ( id_token ["aud" ]) == list
244
+ and len ( id_token [ "aud" ]) >= 1
245
+ and "azp" not in id_token
246
+ ):
247
+ raise JWTError (
248
+ 'Missing authorized party "azp" in IDToken when there '
249
+ "are multiple audiences"
250
+ )
251
251
252
252
except (ExpiredSignatureError , JWTError , JWTClaimsError ) as error :
253
253
raise HTTPException (status_code = 401 , detail = f"Unauthorized: { error } " )
You can’t perform that action at this time.
0 commit comments