Say user1 has logged into his gmail account on my phones chrome browser. Im writing an android app using google rest api's and the pre-requisite is an oauth2 authorization. If i send the authorization url from my app to be opened in the browser then the user1's account is assumed to be authenticated and the authrization page (with Allow/Deny) buttons are shown. How can i programatically, logoff the existing user and then send the oauth2 url from my app so that the user explicitly enters his credentials and also grants the oauth access to my app.
I tried logging off with the follwoing but not successful...
1) https://www.google.com/accounts/logoff?continue=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8080&prompt=consent&response_type=code&client_id=blah-blah-blah"&scope="blah blah"
2) https://accounts.google.com/logoff?continue=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8080&prompt=consent&response_type=code&client_id=blah-blah-blah"&scope="blah blah"
In options 2 and 3, i get a http 400 error that "response_type" is missing but its present in the url that i sent.
Basically my intention is to log off the existing google user and explicitly make the user of my app to sign in to his credentials, so that the oauth2 is done only for his account and not for others (by mistake).