Java Spring: Accepting JWT
Last updated
Last updated
JWT tokens would either be acquired from your Third-Party App’s existing Authentication system or from IndustryApp’s Keycloak authentication configuration.
The following example illustrates how to provision multiple JWT issuers with the resource server in Spring Security 5 with WebSecurityConfigurerAdapter
.
Inside the controller implement the following:
This controller configuration will allow requests routed either via an IndustryApps JWT token or with your Third-Party Applications' JWT token.
For checking user roles we have to map your Third-Party App’s roles into Springs' UserDetailsService function using the JwtTokenFilter function feature to allow recognition of the roles.