Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login with google - how to log out?

I successfully implemented login with google with the example codes provided by google.

However, I'm not sure of how I should use this 'backend-server authentication' thingy.

which is provided in : https://developers.google.com/identity/sign-in/web/backend-auth

I'm developing a website that requires google login and google drive, as the program flows:

  1. User Logins to the website using google account
  2. The User writes some text
  3. The User saves(uploads) to the user's google drive

Before I implement the google drive API, I think I need to handle with the google login system, but I'm not sure how to do it.

Currently, my website goes as 1. User logs in / 2. User logs out / 3. Then the web does not ask the google account, just logs the previous user inside.

Does 'backend-server authentication' gives an answer to my question below?

I understand that it is the same issue as this : How to Logout of an Application Where I Used OAuth2 To Login With Google?. I understood the meaning of the answer, but I cannot find a way to implement to just "log out from the app, not google."

So, to wrap it up, my question will be 2;

  1. How do I use backend-server authentication? (Specifically, the token verifying point)
  2. How do I log out of my web app, not google? and is it related to question 1? (Specifically, if a user logs off from the web app, then another user should be able to log in, by entering their id and password)
like image 263
Paul K Avatar asked Oct 12 '15 14:10

Paul K


People also ask

How do I logout of my Google account?

Sign out on your computerOpen Gmail. In the top right, click your photo. Click Sign out.

How do you log out of a Google account instead of all?

On your device, go to a browser where you're signed in, like Chrome. Go to myaccount.google.com. In the top right, select your profile picture or initial. Select Sign out or Sign out of all accounts.

How do I logout of my Google account on my Iphone?

To sign out, tap your profile image on the top right. Sign out. (If you see an option to "Sign in" instead of your profile image, you're already signed out.) To remove an account, make sure you're signed out.


1 Answers

From this section of the documentation:

You can enable users to sign out of your app without signing out of Google by adding a sign-out button or link to your site. To create a sign-out link, attach a function that calls the GoogleAuth.signOut() method to the link's onclick event.

like image 192
Dan Cornilescu Avatar answered Sep 27 '22 21:09

Dan Cornilescu