Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document audience support in OAuth2 resource server #35286

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,19 @@ Again, the same properties are applicable for both servlet and reactive applicat

Alternatively, you can define your own `OpaqueTokenIntrospector` bean for servlet applications or a `ReactiveOpaqueTokenIntrospector` for reactive applications.

The OAuth2 resource server now supports validating audience (aud) claims in JSON Web Tokens (JWTs) issued by an authorization server.
bikash30851 marked this conversation as resolved.
Show resolved Hide resolved
This feature is added to complement the existing validation of issuer (iss) claims.

To enable audience validation, set the `spring.security.oauth2.resourceserver.jwt.audience` property in your Spring Boot application
bikash30851 marked this conversation as resolved.
Show resolved Hide resolved
configuration file. This property specifies the expected value(s) of the aud claim in JWTs.

For example, to expect the JWTs to contain an aud claim with the value `my-audience`, you can add the following line to your
application.properties file:

[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring.security.oauth2.resourceserver.jwt.audience=my-audience
bikash30851 marked this conversation as resolved.
Show resolved Hide resolved
----

[[web.security.oauth2.authorization-server]]
==== Authorization Server
Expand Down