This briefly introduces integrating Facebook authentication into your web or mobile app.
Last updated
Was this helpful?
This briefly introduces integrating Facebook authentication into your web or mobile app.
Last updated
Was this helpful?
Mainly there are 3 steps involved in having Facebook login integrated into your app.
Create an app in the (Now it's renamed to "Meta for Developers")
Link Facebook to CodeMash. Here you need to enter the App ID and Secret Key you have received from the 1rst step.
Implement Facebook Sign-In capability in your app.
You will need a Facebook project to connect to CodeMash.
Go to the and log in with your Facebook account.
Once you logged in, go ahead and press the "My Apps" menu link and press the button "Create App."
When you create an app, you will be asked how the app will be used. If you just want to have Facebook login capability and get some useful user information to avoid the long onboarding process, choose the "Consumer" type. Otherwise, follow the original Meta for the right app type.
Choose Facebook login and press the "Set up" button as it is shown in the image below.
Under Products now you can see that the Facebook Login section appeared. Press "Settings" and enter https://api.codemash.io/v2/auth/facebook URL in the "Valid OAuth Redirect URIs" input field.
For further integrations, you need to fetch the App ID and App Secret. In this case, click the Settings -> Basic menu item on the left side, and at the very top of the screen, you will see the App ID and App Secret. Copy it and follow the instructions provided below.
Once you have created the app on the "Meta for Developers" portal, copy the App ID and App Secret to CodeMash.
Navigate to your Project > Membership > Settings. Here select Facebook.
In the opened screen enter the following:
App ID - enter your Facebook App ID.
App Secret - enter your Facebook App Secret.
Other recommended fields to fill out (applicable to web scenarios only):
Callback URL - after a successful login, the user will be redirected to this URL.
Logout URL - after successful logout, the user will be redirected to this URL.
Failure URL - after failed login, the user will be redirected to this URL.
To implement Facebook log-in on your website you need
Add a platform called "website" to the Facebook app.
Let's start with the platform.
Go to Settings -> Basic
Scroll down to the very bottom until you will find the "+ Add Platform" button
Press the button and choose the "Website" platform
You only need to provide the URL of your Website which can actually be any URL.
After registering your website on the Facebook Meta platform, it's time to implement a button that calls the right endpoint.
Go to the CodeMash -> Membership -> Integrations -> Facebook and try things like:
Different environments (Production, Development, Test)
Set Callback URL - where you should be redirected after successful login. The same goes when you logout - Logout URL or when a failure occurs - Failure Redirect URL
Log in to the of CodeMash.
Add a login button to the website and call the CodeMash endpoint https://api.codemash.io/v2/auth/facebook. Try out our
Try it out: As a reference, we created a on the platform where you can play with OAuth logins.