Social login with .NET SDK

Hi,

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?

Thanks

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

Hi @Andriy_Konoz

I developed a backendless service with JS loginWithFacebookSdk function, after Facebook access is granted in the phone, I sent the token to the Backendless JS Service. The Service responds with an OK and Facebook returns all the user information. So far so good, but … How can I set the returning information from the loginWithFacebookSdk to my Backendless user in Unity.

I use the user objectId in others Backendless Business Logic functions to allow some actions. If the Unity Backendlees SDK set the user info from the Backendless.UserService.Login function, how can I set this info in Backendless SDK?

Thanks

Hello @Dario_Castaneda

We will be happy to assist you. I need to ask you a few more questions so I can understand the problem better.

What exactly is meant here by Backendless SDK?