title: How to connect spring boot security oauth2 with android app
body: <p>I have a java spring boot application with some web services and to access them you need to login first (the login is made with spring security). I also want to create an android app to login there and access my services. I used for it google oauth and on web app its worked and token is created. Now i wanna to connect it with Android app and there is a problem.
  How can I create the google login in my android app and how to notify spring-security from my server application about that? Mainly how to notify spring-security from my server application about that.
  Here is my spring-security configuration class:</p>
  <pre><code>import org.springframework.context.annotation.Configuration;
  import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  
  @Configuration
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  @Override
  public void configure(HttpSecurity httpSecurity) throws Exception {
  
      httpSecurity
              .antMatcher(&quot;/**&quot;).authorizeRequests()
              .antMatchers(new String[]{&quot;/&quot;, &quot;/not-restricted&quot;}).permitAll()
              .anyRequest().authenticated()
              .and()
              .oauth2Login();
       }
  }
  </code></pre>