title: django-rest-auth with Google: How to post access token properly
body: <p>I'm really new to using <code>retrofit2</code>. I'm trying to send access token to the backend from mobile app and authenticate the user via Google but I can not do it properly. The backend returns 400.
  My code is like this.</p>
  
  <p><code>views.py</code></p>
  
  <pre><code>from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
  from rest_auth.registration.views import SocialLoginView
  
  
  class GoogleLogin(SocialLoginView):
      adapter_class = GoogleOAuth2Adapter
  </code></pre>
  
  <p><code>urls.py</code></p>
  
  <pre><code>path('rest-auth/google/', GoogleLogin.as_view()),
  </code></pre>
  
  <p>And my Java code (I'm using <code>retrofit2</code>)</p>
  
  <pre><code>public interface ApiService {
      // login
      @POST("/rest-auth/google/")
      Call&lt;String&gt; login(@Header("access_token") String accessToken);
  </code></pre>
  
  <p><code>MainActivity.java</code></p>
  
  <pre><code>    private void login() {
      ApiService service = ApiClient.getService();
  
      service.login(mAuthToken).enqueue(new Callback&lt;String&gt;() {
          @Override
          public void onResponse(Call&lt;String&gt; call, Response&lt;String&gt; response) {
  
              if (!response.isSuccessful()) {
                  Toast.makeText(MainActivity.this, "Code:" + response.code(), Toast.LENGTH_LONG).show();
                  return;
              }
  
              Toast.makeText(MainActivity.this, "Success!", Toast.LENGTH_LONG).show();
          }
  
          @Override
          public void onFailure(Call&lt;String&gt; call, Throwable t) {
              mTextViewResult.setText(t.getMessage());
          }
      });
  }
  </code></pre>
  
  <p><code>mAuthToken</code> is access token. I think I'm wrong with the way to pass the access token to backend. I might be wrong with <code>retrofit2</code> part. What am I wrong with this? </p>
  
  <h1>Update</h1>
  
  <p>I found a thing. The access token I get in Android and the access token I get when I login via website is apparently different. I deleted the user and input the access token in the html form manually, the request is accepted. </p>
  
  <p>So I guess there is a problem with access token I get in Android but I have no idea how I can fix this.</p>