I try to achieve the following behavior with Spring Boot:
- When a user wants to log in to my site he can choose from multiple OAuth2 serves (for example Google, Facebook, GitHub, etc...).
- He selects an option (for example google) and logs in with google OAth2.
- Then my site takes the e-mail address from OAuth2 and loads the user from a database to use as Principal.
So I basically want the Principal to always be the same (read from database) and do not depend on which OAuth2 server the user uses to log in.