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

Tenant entity (Company) adds "UserService" in the @Before Execution Pointcut #101

Open
MSSP-BLKing opened this issue Oct 30, 2019 · 2 comments

Comments

@MSSP-BLKing
Copy link

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

@CharlotteFawsitt
Copy link
Contributor

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.

@jduggan83
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants