How can I login again when I logout using Google Plus Auth

388 views Asked by At

To login with Google Plus Auth, I use the example of Python Social Auth at https://github.com/omab/python-social-auth/tree/master/examples/django_example

And I have the scenario as follows:

Firstly, I login by google plus sign in button

<div id="signinButton">
   <span class="g-signin" data-scope="{{ plus_scope }}"
                       data-clientid="{{ plus_id }}"
                       data-redirecturi="postmessage"
                       data-accesstype="offline"
                       data-cookiepolicy="single_host_origin"
                       data-callback="signInCallback">
   </span>
</div>

Secondly, I click on the logout button to sign out

    <a class="btn btn-primary" href="/logout/">
      <i class="fa fa-sign-out"></i>
      Logout
    </a>

Finally, when I login again by Google Plus sign button, the Google popup can not display to enter the username and password. However, I can login again by the button of Django example

   <a class="col-md-2 btn btn-default" name="{{ backend|backend_class }}" href="{% url "social:begin" backend=name %}">
      <i class="fa fa-{{ name|icon_name }}"></i>
      {{ backend|backend_name }}
   </a>

But I don't like this method because this is not recommended from Google https://developers.google.com/+/web/signin/redirect-uri-flow

As I understand, Google popup cannot display because I logged in by Google. I just logout from my django example app. For that reason, the popup cannot open.

However, I think this is a common action of users. They can login/logout many times from our Django apps and they don't need to know about their Google status.

So, is there any approach to login again for my scenario?

Thank you so much

Notes: This is my screen shot

0

There are 0 answers