Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:37:57+00:00 2026-06-12T22:37:57+00:00

In my application, I implemented Google signout using jsapi. I used the url https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=xxxxxx

  • 0

In my application, I implemented Google signout using jsapi.

I used the url https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=xxxxxx to connect to Google and then https://www.googleapis.com/plus/v1/people/xxxxxx to get user data from google profile.

Now I need to signout the user from Google while clicking a button from my application. How can I implement this in JavaScript, or at least it must ask the Google login page every time the user signs in.

I have tried approval_prompt=force, but seems not to be working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:37:58+00:00Added an answer on June 12, 2026 at 10:37 pm

    Overview of OAuth: Is the User Who He/She Says He/She is?:

    I’m not sure if you used OAuth to login to Stack Overflow, like the “Login with Google” option, but when you use this feature, Stack Overflow is simply asking Google if it knows who you are:

    “Yo Google, this Vinesh fella claims that vinesh.e@gmail.com is him, is that true?”

    If you’re logged in already, Google will say YES. If not, Google will say:

    “Hang on a sec Stack Overflow, I’ll authenticate this fella and if he can enter the right password for his Google account, then it’s him”.

    When you enter your Google password, Google then tells Stack Overflow you are who you say you are, and Stack Overflow logs you in.

    When you logout of your app, you’re logging out of your app:

    Here’s where developers new to OAuth sometimes get a little confused… Google and Stack Overflow, Assembla, Vinesh’s-very-cool-slick-webapp, are all different entities, and Google knows nothing about your account on Vinesh’s cool webapp, and vice versa, aside from what’s exposed via the API you’re using to access profile information.

    When your user logs out, he or she isn’t logging out of Google, he/she is logging out of your app, or Stack Overflow, or Assembla, or whatever web application used Google OAuth to authenticate the user.

    In fact, I can log out of all of my Google accounts and still be logged into Stack Overflow. Once your app knows who the user is, that person can log out of Google. Google is no longer needed.

    With that said, what you’re asking to do is log the user out of a service that really doesn’t belong to you. Think about it like this: As a user, how annoyed do you think I would be if I logged into 5 different services with my Google account, then the first time I logged out of one of them, I have to login to my Gmail account again because that app developer decided that, when I log out of his application, I should also be logged out of Google? That’s going to get old really fast. In short, you really don’t want to do this…

    Yeh yeh, whatever, I still want to log the user out Of Google, just tell me how do I do this?

    With that said, if you still do want to log a user out of Google, and realize that you may very well be disrupting their workflow, you could dynamically build the logout url from one of their Google services logout button, and then invoke that using an img element or a script tag:

    <script type="text/javascript" 
        src="https://mail.google.com/mail/u/0/?logout&hl=en" />
    

    OR

    <img src="https://mail.google.com/mail/u/0/?logout&hl=en" />
    

    OR

    window.location = "https://mail.google.com/mail/u/0/?logout&hl=en";
    

    If you redirect your user to the logout page, or invoke it from an element that isn’t cross-domain restricted, the user will be logged out of Google.

    Note that this does not necessarily mean the user will be logged out of your application, only Google. 🙂

    Summary:

    What’s important for you to keep in mind is that, when you logout of your app, you don’t need to make the user re-enter a password. That’s the whole point! It authenticates against Google so the user doesn’t have to enter his or her password over and over and over again in each web application he or she uses. It takes some getting used to, but know that, as long as the user is logged into Google, your app doesn’t need to worry about whether or not the user is who he/she says he/she is.

    I have the same implementation in a project as you do, using the Google Profile information with OAuth. I tried the very same thing you’re looking to try, and it really started making people angry when they had to login to Google over and over again, so we stopped logging them out of Google. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building an Android application using Google's GCM service. I have implemented the onRegistered method
I am implemented Google map in my application it's showing Google map on device
I have implemented Google Analytics in my iPhone Application. And I can able to
I have implemented an iframe into my flex application. The iframe contains a google
I've implemented a service that does an asynchronous sync between my application and google
I have the following problem. I have a tabbed application implemented using a ViewPager.
In our Android application I implemented the contact selection by using Intent action *ACTION_PICK*
I am using google map in my application. I have an application regarding to
i create a chat application using Adobe FLEX, currently it is not implemented yet,
I have implemented admob code as given in google site (http://code.google.com/mobile/ads/docs/android/fundamentals.html) as described in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.