I have a standard Spring Boot / Hibernate multi tenancy (schema) solution, but I am unable to intercept the oauth token request in / oauth / token.
It seems like HandlerInterceptor instances are being called for any request, but not the ones that point to the endpoint of my token. This is a problem because I need a lot of tenants.
So, I need some class that is called at the beginning of any request to retrieve tenant information from the request, which will then be stored in some ThreadLocal. And also I need a method called after processing the request to remove tenant information from ThreadLocal for security.
I think WebFilter is not enough, as it will only be called once per request. And any MVC handler / interceptor does not receive calls for my oauth endpoints that are configured with Spring's automatic boot configuration and seem to bypass the mvc call.
Is it possible to intercept the oauth resource with mvc handlers? Is there any other solution to my problem than using RequestContextHolder?
Any clue ideas - thanks in advance! Gerrit
source share