Skip to content

GraphQL - signUp/createUser mutation throws error: This authentication method is unsupported #6306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tran-huy-phuc opened this issue Dec 28, 2019 · 4 comments

Comments

@tran-huy-phuc
Copy link

Issue Description

Using GraphQL playground to test signUp/createUser using Facebook. It throws error "This authentication method is unsupported"

The mutation:

mutation loginWithFacebook(
  $fbId: String
  $accessToken: String
  $expirationDate: String
) {
  createUser(
    fields: {
      authData: {
        facebook: {
          id: $fbId
          access_token: $accessToken
          expiration_date: $expirationDate
        }
      }
    }
  ) {
    username
    email
    id
  }
}

Environment Setup

  • Parse server config
{
 ...
  "auth": {
    "facebook" : {
      "appIds": ["my_fb_app_id"],
      "id": "user's Facebook id number as a string",
      "access_token": "an authorized Facebook access token for the user",
      "expiration_date": "token expiration date of the format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
    },
    "google": {
      "id": "user's Google id (string)",
      "id_token": "an authorized Google id_token for the user (use when not using access_token)",
      "access_token": "an authorized Google access_token for the user (use when not using id_token)"
    }
  },
...
  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.9.0
    • Operating System: Ubuntu
    • Hardware: AWS EC2
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): AWS
  • Database

    • MongoDB version: 3.6.3
    • Storage engine: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): same server with parse-server (Ubuntu on AWS EC2)

Logs/Trace

{
  "errors": [
    {
      "message": "This authentication method is unsupported.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "signUp"
      ],
      "extensions": {
        "code": 252,
        "exception": {
          "stacktrace": [
            "Error: This authentication method is unsupported.",
            "    at toGraphQLError (/usr/lib/node_modules/parse-server/lib/GraphQL/parseGraphQLUtils.js:33:10)",
            "    at ParseGraphQLSchema.handleError (/usr/lib/node_modules/parse-server/lib/GraphQL/ParseGraphQLSchema.js:237:49)",
            "    at resolve (/usr/lib/node_modules/parse-server/lib/GraphQL/loaders/usersMutations.js:55:28)",
            "    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
          ]
        }
      }
    }
  ],
  "data": null
}
@davimacedo
Copy link
Member

davimacedo commented Jan 5, 2020

I think the problem is in your Parse Server config. It should be something like this:

{
 ...
  "oauth": {
    "facebook" : {
      "appIds": ["my_fb_app_id"]
    }
  },
...

Note that it is oauth and not auth.

@tran-huy-phuc
Copy link
Author

tran-huy-phuc commented Jan 5, 2020

Thanks @davimacedo
Really? I will try but I used "auth" for my other parse server backends.

And with current config ("auth"), when I use Parse SDK, I can login with Facebook successfully

@davimacedo
Copy link
Member

Sorry. You're right. It should be auth. But try just passing the appIds and not the other settings. Also make sure that your $fbId var is not empty. I've received the same error when I sent an empty value.

@Moumouls
Copy link
Member

Probably closed by: #6371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants