Open MSSP-BLKing opened 5 years ago
Thank you for bringing this up. We will look into this issue and if you have any other suggestions for this it would be appreciated.
Hi @BLKingLLC
I have a had a look into this and unfortunately there is no obvious fix. We need to keep this piece ofcode to ensure users with a tenant can't see other tenants. Have you implemented any fix on your project that we could incirporate into the blueprint?
When an OAuth2 user logs in for the first time, their login information is stored in the JHI_USER table, using the syncUserWithIDP method in UserService.
The multitenancy blueprint adds UserService to the Tennant Entity (Company) Aspect class in the beforeExecution method. With this setting, every time the UserService is called it runs userRepository.findOneByLogin, but because sycUserWithIDP hasn't run yet the user is not in the DB throwing a "java.util.NoSuchElementException: No value present" stack trace.
Removing UserService from the pointcut alleviates the issue, but may open a way to see users from other companies