eclipse-vertx / vertx-auth

Apache License 2.0
166 stars 156 forks source link

OAuth2Auth: access_token fails validation if configuration has multiple audiences #626

Closed srjakes closed 1 year ago

srjakes commented 1 year ago

In my configuration I have two audiences.

At this point in the validation code I have an access_token with a single value in the aud claim that matches one of the configured audiences.

https://github.com/eclipse-vertx/vertx-auth/blob/67b237b1cdca069c1a8b2d2b1f4f2f15c8e4b113/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/OAuth2AuthProviderImpl.java#L618

The access_token fails validation because the other audience from the configuration is not in the aud claim.

The similar check in vertx-auth-jwt does a Collections.disjoint on the configured audiences and the aud claim.

I think that my access_token should pass this audience validation check.