Support Topics Documentation Slack YouTube Blog

Social login with .NET SDK


I want to use social login in an Unity application, I’m using .NET SDK, but in the documentation this SDK doesn’t support this functionality like others SKDs.

Which approach do you propose to use “social login” with Backendless service?

I’m using Facebook and Google and the javascript SDK have the functionallity, I was planning to create a service in backend to send the login information, but, which info is required to login? and, The Backendless platform notifies me when the user removes the access permission?


Hi @Dario_Castaneda!

Sorry for inconvenience. We will add support for social networks login in the nearest future.
As for now you have two options:

  1. Create your custom service written in JS which will just perform calls to corrsponding JS SDK methods.
  2. Use REST endpoints for social login. They have similar signature to JS SDK methods.

In both variants you need to obtain access token from Google/Facebook. You can do it using their SDKs.

Methods for login in JS SDK is next:

  async loginWithFacebookSdk(
            accessToken, /* Access tocken obtained from Facebook */
            fieldsMapping, /* Fields mapping between Facebook user fields and Backendless Users table. Must be passed as object. If you don't have custom mappings, you can pass it as empty object or even st default value in service - Backendless will use default mappings */
            stayLoggedIn, /* If true user will be set as "current user" in SDK. In your case it doesn't matter and can be set to false on service side. */
            options /* Must be empty list */

  async loginWithGooglePlusSdk(accessToken, fieldsMapping, stayLoggedIn)

As you can see, your service methods will accept only two params - “accessToken” and “fieldsMapping” or even just “accessToken” if you don’t have custom field mappings. Other params will have default values on service side.
As result both methods will return authorized Backendless user data.

If you have any further questions I will be hapy to help you.

Regards, Andriy

Thank you @Andriy_Konoz