Auth0 Home Blog Docs

How do I create a user that is signing up via Facebook?

signup
facebook
auth0swift

#1

We are using Auth0.swift. We would like to offer our users the ability to sign up for our service using Facebook, without being required to provide email/password, and then subsequently use the loginSocial function to log in using the FB token. However, I’m not seeing a createUser function that can be used with Facebook.

Is there an example that shows how to create a Facebook signup flow using the Auth0.swift framework? We are not planning on using Lock, as we have specific UI requirements that won’t be met by customizing the Lock login page.


#2

The loginSocial function translates to a call to /oauth/access_token endpoint which as mentioned in the docs is part of the legacy API surface and as such it’s not recommended. The recommendation would be to perform social login through the system browser.

Having said that, the registration/signup of a social user is very much indistinguishable of a subsequent authentication operation; the main difference is that if it’s the first time the users completes the authentication then a user record will be created in your tenant and associated with the social connection. In conclusion, if you call the endpoint in question with a valid social provider access token and the user does not yet exist in your tenant then it will just be created as part of completing that login operation; there is no specific create user step for social connection users.


#3