Auth0 Home Blog Docs

loginSocial for Facebook is not working in Swift

let auth = Auth0.authentication(clientId: ,
domain: ,
session: .shared)

auth.loginSocial(token: , connection: “facebook”).start
{ result in

OutPut : failure(error: Not Found).

Please help me I am stuck on this. Am I doing something wrong?

1 Like

Hi @kamlesh.jswal Welcome to Auth0 Community

Can you clarify what is not working for you?

  • Are you seeing facebook login screen or not?
  • is there any error that you get?
  • Is the facebook connection properly setup? Does the Try connection button work for you in Auth0 dashboard?

Hi Ashish,

Thanks for your reply.
Following are the steps I am performing.

  1. Created application in Facebook developer account.
  2. Setup Facebook appid and secret in Connection -> Social -> Facebook -> Settings.
  3. Click on Try and and its working.

Now what I am doing in my application.
I have a button in my login page “Login with Facebook”.
On click this button I am opening facebook page using Facebook iOS SDK.
After successful login from facebook I am getting FBAccessToken string and this token I am passing in method below.

let auth = Auth0.authentication(clientId: APP_CLIENT_ID,
domain: APP_DOMAIN) ,
session: .shared)

auth.loginSocial(token: TOKEN_OBTAINED_FROM_FACEBOOK_AFTER_LOGIN_IN_FACEBOOK, connection: “facebook”).start
{ result in

OutPut : failure(error: Not Found).