Open synle opened 7 years ago
We have updated this in the YakYak app some time ago, but not in hangupsjs itself :\
I'm not really sure on this.. @davibe ?
My workaround is to start a session with YakYak and then copy Cookies
, cookies.json
and refreshtoken.txt
to hangupsjs
folder
@averissimo hello! I'm kind of new to node.js and OAuth. I can't seem to get the constructors to be happy setting it to read from the CookieJar. May I ask if you don't mind sharing your code that let's you read the files from YakYak? I would greatly appreciate it!
@dosmage
https://github.com/averissimo/hangupsjs/tree/my_blank_login
I use this code to test some stuff, see src/login.coffee
..
To get the right scope files:
~/.config/yakyak[Cookies,cookies.json,refreshtoken.txt]
to the hangupsjs root directorygulp
ps. I use some stuff inside login to send 'Hello World' messages to specific conversations and check for user presence (all depending on the login user)... you can use that code as inspiration
Hi you said it is fixed in yakyak? Where do you the login in YakYak?
Got same error. What else scopes we can try? I tried https://www.googleapis.com/auth/plus.login scope... the response
2017-07-22 12:05:42 DEBUG requesting refresh token 2017-07-22 12:05:42 DEBUG auth with code success 2017-07-22 12:05:42 DEBUG attempt to get session cookies ya29.GmCQBIm5oHiERSQPIj3-TRttWGEh07yKamTZZGoZKlkbEDjGhCtW4fxuXXL_15ZqxKCUECIBtf9Pn0jlU05zVCczUC4UV9U1e0cJiaTjivrU3ftnIOTrnHWWz8hIMwExb0k 2017-07-22 12:05:42 DEBUG requesting uberauth 2017-07-22 12:05:43 ERROR getAuth failed { [Error: Forbidden] code: 403, message: 'Forbidden', body: 'Error=badauth\n' } 2017-07-22 12:05:43 DEBUG emit connect_failed { [Error: Forbidden] code: 403, message: 'Forbidden', body: 'Error=badauth\n' }
/Users/max/projects/js/node_modules/q/q.js:155 throw e; ^ Error: Forbidden
It is because of the wrong scope?
Check this: https://productforums.google.com/forum/#!topic/hangouts/LU2YZNDhN_s
The necessary authentication endpoint must be changed to programmatic_auth, the caveat is that the code does not appear directly in the page, it must be retrieved by inpector :\
I've just tested the code below, it should work using the workaround described in the link/video
https://github.com/yakyak/yakyak/blob/master/src/login.coffee#L7
OAUTH2_CLIENT_ID = '936475272427.apps.googleusercontent.com'
OAUTH2_CLIENT_SECRET = 'KWsJlkaMn1jGLxQpWxMnOox-'
OAUTH2_SCOPE = 'https://www.google.com/accounts/OAuthLogin https://www.googleapis.com/auth/userinfo.email'
OAUTH2_DELEGATED_CLIENT_ID = '183697946088-m3jnlsqshjhh5lbvg05k46q1k4qqtrgn.apps.googleusercontent.com'
OAUTH2_PARAMS =
hl: 'en'
scope: OAUTH2_SCOPE
client_id: OAUTH2_CLIENT_ID
access_type: 'offline'
delegated_client_id: OAUTH2_DELEGATED_CLIENT_ID
top_level_cookie: '1'
OAUTH2_QUERY = ("&#{k}=#{encodeURIComponent(v)}" for k, v of OAUTH2_PARAMS).join('')
OAUTH2_LOGIN_URL = "https://accounts.google.com/o/oauth2/programmatic_auth?#{OAUTH2_QUERY}"
OAUTH2_TOKEN_REQUEST_URL = 'https://accounts.google.com/o/oauth2/token'
or see branch scope_workaround for a working example
@averissimo Branch scope_workaround
does not work for me. I see the URL with "programmatic_auth" instead of "auth", but when opened it asks my password and then hangs indefinitely with "One moment please..."
Got same error. What else scopes we can try? I tried https://www.googleapis.com/auth/plus.login scope... the response
2017-07-22 12:05:42 DEBUG requesting refresh token 2017-07-22 12:05:42 DEBUG auth with code success 2017-07-22 12:05:42 DEBUG attempt to get session cookies ya29.GmCQBIm5oHiERSQPIj3-TRttWGEh07yKamTZZGoZKlkbEDjGhCtW4fxuXXL_15ZqxKCUECIBtf9Pn0jlU05zVCczUC4UV9U1e0cJiaTjivrU3ftnIOTrnHWWz8hIMwExb0k 2017-07-22 12:05:42 DEBUG requesting uberauth 2017-07-22 12:05:43 ERROR getAuth failed { [Error: Forbidden] code: 403, message: 'Forbidden', body: 'Error=badauth\n' } 2017-07-22 12:05:43 DEBUG emit connect_failed { [Error: Forbidden] code: 403, message: 'Forbidden', body: 'Error=badauth\n' } /Users/max/projects/js/node_modules/q/q.js:155 throw e; ^ Error: Forbidden
It is because of the wrong scope?
Any information about this? I'm facing this since couple of days and can't find any information.
Are you using version 1.5.7 or above?
I'm using 1.3.8 and getting this:
2020-06-21 22:30:00 WARN no init data for apikey 2020-06-21 22:30:00 WARN no init data for email 2020-06-21 22:30:00 WARN no init data for headerdate 2020-06-21 22:30:00 WARN no init data for headerversion 2020-06-21 22:30:00 WARN no init data for headerid 2020-06-21 22:30:00 WARN no init data for timestamp 2020-06-21 22:30:00 WARN no init data for self_entity 2020-06-21 22:30:00 WARN no init data for conv_states { "error": { "errors": [ { "domain": "usageLimits", "reason": "dailyLimitExceededUnreg", "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.", "extendedHelp": "https://code.google.com/apis/console" } ], "code": 403, "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } }
I'm using the token mentioned earlier, not sure what has changed. Updating it won't do the trick.
I'm using lastest version of git "npm install https://github.com/yakyak/hangupsjs.git" after that I needed to auth again and everything works again
@Undrium sorry, I thought I was in the yakyak app context. You can use the code from github, but I'll ask the person with npm permissions to bump the new version.
@davibe can you push a new version (1.3.9) to npm ?
I got this error trying to set up the oauth