File tree Expand file tree Collapse file tree
VirtualFinland.UserAPI/src/VirtualFinland.UsersAPI/Helpers/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,10 +34,16 @@ public async Task VerifyAudience(string audience)
3434 using var response = await _httpClient . GetAsync ( verifyUrl ) ;
3535 response . EnsureSuccessStatusCode ( ) ;
3636
37- var responseData = await JsonSerializer . DeserializeAsync < AudienceVerifyResponse > ( await response . Content . ReadAsStreamAsync ( ) ) ??
37+ var responseData = await JsonSerializer . DeserializeAsync < AudienceVerifyResponse > ( await response . Content . ReadAsStreamAsync ( ) , new JsonSerializerOptions ( )
38+ {
39+ PropertyNameCaseInsensitive = true
40+ } ) ??
3841 throw new NotAuthorizedException ( "Could not verify audience" ) ;
3942
40- if ( ! _config . AllowedGroups . Contains ( responseData . Group ) ) throw new NotAuthorizedException ( "Audience group is not allowed" ) ;
43+ if ( ! _config . AllowedGroups . Contains ( responseData . Group ) )
44+ {
45+ throw new NotAuthorizedException ( "Audience group is not allowed" ) ;
46+ }
4147
4248 // Cache audience for 24 hours
4349 await _cacheRepository . Set ( audience , responseData , TimeSpan . FromHours ( 24 ) ) ;
You can’t perform that action at this time.
0 commit comments