Skip to content

Cloud code returning {"code":209,"message":"invalid session token"} Google Login; #3003

Closed
@abhijeet-aressindia

Description

@abhijeet-aressindia

I have implemented google+ login with Parse.com by the Cloud code with the reference of https://groups.google.com/forum/#!topic/parse-developers/UUvTreGYOrI. Now our Parse app (Parse-server) is migrated to Heroku.
Login and signup with Email and password , with Facebook and with Twitter is working properly.

I have added ParseUser.enableRevocableSessionInBackground(); after the initialization of Parse for session migration (https://parse.com/tutorials/session-migration-tutorial) to migrate users session to revocable session .

With Google+ Signup/Login my app getting crashed, with some server logs i have found that sessionToken getting undefined which is required for ParseUser.becomeInBackground() for registering user.

Edit 1:

Now I have able to register new user without any error and getting session started with r: but login is still is not working for existing and newly created user.

I have already check following ref. but get nothing specific.

  1. Added support for legacy session tokens #1749
  2. Add support for non-revocable sessions #1392
  3. Queries never fail with 'InvalidSessionToken' error when user is logged with legacy session token #1605

My App is already live on both Android and iOS platforms and now i want to migrate legacy sessions to improved revocable session, but now stuck on the undefined response from cloud code.

Expected Results

[sessionToken]

Actual Outcome

[undefined]

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : [2.2.21]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [Heroku]
  • Database

    • MongoDB version: [3.2.9]
      • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [mLab]

Logs/Trace

You can turn on additional logging by configuring VERBOSE=1 in your environment.

[2016-11-03T13:48:13.965095+00:00 app[web.1]: verbose: REQUEST for [GET] /server/classes/_User/GJ2LHh1k6S: {} method=GET, url=/server/classes/_User/GJ2LHh1k6S, host=espressoft-parse-server.herokuapp.com, connection=close, user-agent=node-XMLHttpRequest, Parse/js1.9.1 (NodeJS 5.11.1), accept=/, content-type=text/plain, x-request-id=74772963-ec61-445b-bc21-03f881c4fd00, x-forwarded-for=54.87.78.152, x-forwarded-proto=http, x-forwarded-port=80, via=1.1 vegur, connect-time=1, x-request-start=1478180893972, total-route-time=0, content-length=217,
2016-11-03T13:48:14.067598+00:00 app[web.1]: verbose: RESPONSE from [GET] /server/classes/_User/GJ2LHh1k6S: {
2016-11-03T13:48:14.067601+00:00 app[web.1]: "response": {
2016-11-03T13:48:14.067602+00:00 app[web.1]: "objectId": "GJ2LHh1k6S",
2016-11-03T13:48:14.067603+00:00 app[web.1]: "username": "U7yt5Rolfb0W1/4HULJOe7JsShs8bAVR",
2016-11-03T13:48:14.067604+00:00 app[web.1]: "email": "[email protected]",
2016-11-03T13:48:14.067604+00:00 app[web.1]: "firstName": "Kushal",
2016-11-03T13:48:14.067605+00:00 app[web.1]: "lastName": "Dixit",
2016-11-03T13:48:14.067606+00:00 app[web.1]: "account_type": "g",
2016-11-03T13:48:14.067606+00:00 app[web.1]: "createdAt": "2016-10-05T11:01:15.284Z",
2016-11-03T13:48:14.067607+00:00 app[web.1]: "updatedAt": "2016-10-05T11:01:15.284Z",
2016-11-03T13:48:14.067608+00:00 app[web.1]: "ACL": {
2016-11-03T13:48:14.067609+00:00 app[web.1]: "": {
2016-11-03T13:48:14.067609+00:00 app[web.1]: "read": true
2016-11-03T13:48:14.067610+00:00 app[web.1]: },
2016-11-03T13:48:14.067610+00:00 app[web.1]: "GJ2LHh1k6S": {
2016-11-03T13:48:14.067611+00:00 app[web.1]: "read": true,
2016-11-03T13:48:14.067612+00:00 app[web.1]: "write": true
2016-11-03T13:48:14.067612+00:00 app[web.1]: }
2016-11-03T13:48:14.067613+00:00 app[web.1]: }
2016-11-03T13:48:14.067614+00:00 app[web.1]: }
2016-11-03T13:48:14.067615+00:00 app[web.1]: } objectId=GJ2LHh1k6S, username=U7yt5Rolfb0W1/4HULJOe7JsShs8bAVR, email=[email protected], firstName=Kushal, lastName=Dixit, account_type=g, createdAt=2016-10-05T11:01:15.284Z, updatedAt=2016-10-05T11:01:15.284Z, read=true, read=true, write=true
2016-11-03T13:48:14.132654+00:00 app[web.1]: verbose: REQUEST for [PUT] /server/classes/TokenStorage/Egvw7pYR11: {} method=PUT, url=/server/classes/TokenStorage/Egvw7pYR11, host=espressoft-parse-server.herokuapp.com, connection=close, user-agent=node-XMLHttpRequest, Parse/js1.9.1 (NodeJS 5.11.1), accept=
/*, content-type=text/plain, x-request-id=35692a8e-cddb-4ad0-bda6-8965f32aadae, x-forwarded-for=54.87.78.152, x-forwarded-proto=http, x-forwarded-port=80, via=1.1 vegur, connect-time=1, x-request-start=1478180894118, total-route-time=0, content-length=217,
2016-11-03T13:48:14.528455+00:00 heroku[router]: at=info method=POST path="/server/classes/TokenStorage/Egvw7pYR11" host=espressoft-parse-server.herokuapp.com request_id=35692a8e-cddb-4ad0-bda6-8965f32aadae fwd="54.87.78.152" dyno=web.1 connect=1ms service=408ms status=200 bytes=522
2016-11-03T13:48:14.532305+00:00 heroku[router]: at=info method=POST path="/server/functions/accessGoogleUser" host=espressoft-parse-server.herokuapp.com request_id=b6962a03-325a-4937-9f98-4fdf1b7a3a57 fwd="49.248.139.244" dyno=web.1 connect=1ms service=1149ms status=200 bytes=483
2016-11-03T13:48:14.506716+00:00 app[web.1]: verbose: RESPONSE from [PUT] /server/classes/TokenStorage/Egvw7pYR11: {
2016-11-03T13:48:14.506730+00:00 app[web.1]: "response": {
2016-11-03T13:48:14.506732+00:00 app[web.1]: "updatedAt": "2016-11-03T13:48:14.132Z"
2016-11-03T13:48:14.506732+00:00 app[web.1]: }
2016-11-03T13:48:14.506733+00:00 app[web.1]: } updatedAt=2016-11-03T13:48:14.132Z
2016-11-03T13:48:14.510413+00:00 app[web.1]: Session_Token:undefined
2016-11-03T13:48:14.511265+00:00 app[web.1]: info: Ran cloud function accessGoogleUser for user undefined with:
2016-11-03T13:48:14.511267+00:00 app[web.1]: Input: {"email":"[email protected]","code":"ya29.CjGKAxy9fFeCNYtgI7Gswiug8iIH_rnFTy7RytNtWrsm5rku3CJdyviSiD1AR768Cg31"}
2016-11-03T13:48:14.511268+00:00 app[web.1]: Result: undefined functionName=accessGoogleUser, email=[email protected], code=ya29.CjGKAxy9fFeCNYtgI7Gswiug8iIH_rnFTy7RytNtWrsm5rku3CJdyviSiD1AR768Cg31, user=undefined
2016-11-03T13:48:14.511886+00:00 app[web.1]: verbose: RESPONSE from [POST] /server/functions/accessGoogleUser: {
2016-11-03T13:48:14.511899+00:00 app[web.1]: "response": {}
2016-11-03T13:48:14.511900+00:00 app[web.1]: } result=undefined]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions