android - oauth2: Logoff currently logged in google user and then send the oauth url from my app -
say user1 has logged gmail account on phones chrome browser. im writing android app using google rest api's , pre-requisite oauth2 authorization. if send authorization url app opened in browser user1's account assumed authenticated , authrization page (with allow/deny) buttons shown. how can programatically, logoff existing user , send oauth2 url app user explicitly enters credentials , grants oauth access app.
i tried logging off follwoing 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 , 3, http 400 error "response_type" missing present in url sent.
basically intention log off existing google user , explicitly make user of app sign in credentials, oauth2 done account , not others (by mistake).
i added parameter "prompt=select_account+consent" http request , worked me. irrespective of current user logged browser, login screen shown user.
https://accounts.google.com/o/oauth2/v2/auth?prompt=select_account+consent
Comments
Post a Comment