However, the _parse_json function in JWTDecoder will treat incoming aud claims as Array. This makes verification impossible because of an error in assert_claim_values:
Invalid operands 'Array' and 'PackedStringArray' in operator '=='.
To Reproduce
# This stuff needs to be configured
var alg : JWTAlgorithm
var jwt : String
var jwt_verifier: JWTVerifier = JWT.require(alg) \
.with_audience(["expected audience"]) \
.build()
if jwt_verifier.verify(jwt) != JWTVerifier.JWTExceptions.OK :
print(jwt_verifier.exception)
Expected behavior
Expectation is that the verification either succeeds or fails.
Bug report
Unable to verify the
aud
claim.Describe the bug
In a JWT, the
aud
claim is an array.JWT creation using
JWTBaseBuilder
treats the array as aPackedStringArray
So does
JWTVerifierBuilder
:However, the
_parse_json
function inJWTDecoder
will treat incomingaud
claims asArray
. This makes verification impossible because of an error inassert_claim_values
:To Reproduce
Expected behavior
Expectation is that the verification either succeeds or fails.
Screenshots
System information