Start a new topic

Kinvey html5 with google oauth 2 and angular front end


I am trying to use social.connect to authenticate users with their google accounts. I have the necessary B/L in place as well. What I want is that I want to ONLY authenticate the user but NOT create a new user on kinvey. To achieve that I pass create:false in to the Social .connect call:

$kinvey.Social.connect(null, 'google', {create: false})

But for some reason the promise from above always returns an error, "UserNotFound". It works fine when I remove the create:false parameter. Any thoughts / suggestions?

1 Comment

The connect method is meant to associate a social identity with a Kinvey user. The `create: false` flag prohibits creating a Kinvey user when there is no Kinvey user yet for the Google Account the user logged in with. In that case, the library will return the `UserNotFound` error. Without the `create: false` flag, a new user will be created instead of returning `UserNotFound`.

If you don’t want to use Kinvey users, but still authenticate through Google, I recommend not using the library for this purpose. I wonder, however, what your exact use case is?
Login or Signup to post a comment