title: How to restrict to a specific domain to login with Spring-Boot and OAuth2
body: <p>I have successfully done a OAuth2 login with spring boot and Google, but I'd like to restrict logins to a specific domain (we're using Google Apps for Work).</p>
  
  <p>I think that I should handle by extending class OAuth2ClientAuthenticationProcessingFilter (as specified <a href="https://stackoverflow.com/questions/34855468/spring-boot-and-oauth2-social-login-unable-to-get-refreshtoken">in this thread</a>), but I'm not sure how to do that.</p>
  
  <p>Basically, I'd like to use Google OAuth 2.0 as the identity provider, but only company users (@company.com) must be accepted.</p>