I have been working back-end JWT validation and I've been using the JJWT library.
When building the JwtsParser we can call
.requireAudience("audience")
And this will attempt to match the audience claim in the JWT token and verify it or not depending on the result.
I have a situation where I have multiple audiences (two different front-ends) and I am trying to match the audience to either front-end 1 or front-end 2. However, when I add
.requireAudience("FE1")
.requireAudience("FE2")
it attempts to match both of those values.
Is there any way to achieve this functionality with the library or should I just write my own audience verify method?
try following changes:
and then: