Kumar, Your google.accounts.user.logout() is used incorrectly. That method takes an optional callback as a first argument and an optional scope string as the second.
So, to revoke just the docs token: google.accounts.user.logout(function() { alert('docs token revoked'); window.location.reload(); // just refresh the page }, 'http://docs.google.com/feeds/'); Eric On Jul 14, 9:42 pm, widget develop <widgetdeve...@gmail.com> wrote: > Hi Kumar , > I tried to login gmail with userid and password ,but i am unable to > login ,can you please solve this problem? > My code is : > > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=utf-8"> > <title>GmailUI</title> > </head> > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > google.load('gdata', '1'); > google.setOnLoadCallback(logMeIn); > google.accounts.user(); > function logMeIn() { > var token = google.accounts.user.login('http:// > userid:passw...@gmail.google.com/gmail/feed/atom','http://www.gmail.com'); > alert("Value is:",token); > } > function onLoadNotify(){ > alert("Page laoded"); > } > </script> > <body onload="onLoadNotify();"> > <input type="button" value ="Login" onclick="logMeIn();"/> > </body> > </html> > > Thanx & Regards > Ajay > > On Jun 22, 11:48 pm, Kumar <kumaravel.kandas...@gmail.com> wrote: > > > Hi, > > > I would like to get feedback from the community whether the following > > is an expected behavior or bug. > > > Feedback appreciated. Thanks, > > Kumar > > > Steps: > > 1) Got access token for docs.google.com to create spreadsheets. > > > var docToken = google.accounts.user.login('http://docs.google.com/ > > feeds/'); > > > 2) Got access token for spreadsheets.google.com to modify > > spreadsheets. > > > var spToken = google.accounts.user.login('http:// > > spreadsheets.google.com/feeds/'); > > > 3) Remove the docToken created in step 1. > > > google.accounts.user.logout('http://docs.google.com/feeds/'); > > > Expected result based of the > > documentationhttp://code.google.com/apis/gdata/jsdoc/1.10/google/accounts/user.htm..., > > the user should be only logged out of the docs.google.com - i.e. > > docToken removed. > > > However, what is happening is spToken is removed and docToken still > > remains. > > > Sample Code: > > > <html> > > <head> > > <title>Test</title> > > <meta name="viewport" content="user-scalable=false"> > > <script type="text/javascript" src="http://www.google.com/ > > jsapi"></script> > > <script> > > > google.load('gdata', '1'); > > google.setOnLoadCallback(toggleBtn);//do nothing. > > > function toggleBtn() { > > > if (google.accounts.user.checkLogin('http:// > > docs.google.com/feeds/') == '') { > > > document.getElementById("dBtn").value = "Grant > > Docs Access"; > > document.getElementById("dBtn").onclick = function > > () {grantDocAccess();}; > > > } else { > > > document.getElementById("dBtn").value = "Revoke > > Docs Access"; > > document.getElementById("dBtn").onclick = function > > () {revokeDocAccess();}; > > > } > > > if (google.accounts.user.checkLogin('http:// > > spreadsheets.google.com/feeds/') == '') { > > > document.getElementById("sBtn").value = "Grant > > Spreadsheet Access"; > > document.getElementById("sBtn").onclick = > > function() {grantSpreadsheetAccess();}; > > > } else { > > > document.getElementById("sBtn").value = "Revoke > > Spreadsheet Access"; > > document.getElementById("sBtn").onclick = function > > () {revokeSpreadsheetAccess();}; > > > } > > checkStatus(); > > > } > > > function grantDocAccess() { > > > var token = google.accounts.user.login('http:// > > docs.google.com/feeds/'); > > > toggleBtn(); > > > } > > > function revokeDocAccess() { > > > var status = google.accounts.user.logout('http:// > > docs.google.com/feeds/'); > > toggleBtn(); > > > } > > > function grantSpreadsheetAccess() { > > > var token = google.accounts.user.login('http:// > > spreadsheets.google.com/feeds/'); > > toggleBtn(); > > > } > > > function revokeSpreadsheetAccess() { > > > var status = google.accounts.user.logout('http:// > > spreadsheets.google.com/feeds/'); > > toggleBtn(); > > > } > > > function checkStatus() { > > > document.getElementById("doc_token").innerHTML = > > 'http://docs.google.com/feeds/'+": " + > > google.accounts.user.checkLogin('http://docs.google.com/feeds/');; > > document.getElementById("sp_token").innerHTML = > > 'http://spreadsheets.google.com/feeds/'+": " + > > google.accounts.user.checkLogin('http://spreadsheets.google.com/ > > feeds/');; > > } > > </script> > > </head> > > <body> > > <input id="dBtn" type="button" value="Grant Docs Access" > > onclick="grantDocAccess()"/><br> > > <input id="sBtn" type="button" value="Grant Spreadsheet > > Access" onclick="grantSpreadsheetAccess()"/><br> > > <input type="button" value="Check token status" > > onclick="checkStatus()"><br> > > > <div id="doc_token"></div><br> > > <div id="sp_token"></div> > > > </body> > > </html> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" group. To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com To unsubscribe from this group, send email to google-docs-data-apis+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---