Learn how to integrate Facebook OAuth authentication with Hanko for secure user login.
Login
to create an account./thirdparty/callback
endpoint.
To find your redirect URL:
Organization
.Project
.Settings
, then select Social connections
.Redirect URL
input.Apps
.Create app
in the center of the page or on the top right.Next
.Use cases
view, select Authenticate and request data from users with Facebook Login
.Next
.Business
view, select I don't want to connect a business portfolio yet
(or connect your existing business portfolio if available).Next
.Create app
view, click Go to dashboard
.Customize adding a Facebook Login button
in the Add and customize use cases
section.Customize use case
view, select Permissions
in the left sidebar.add
button for the email
permission in the permissions table to enable email access.Customize use case
view, select Settings
in the left sidebar.Valid OAuth Redirect URIs
, add the redirect URL you retrieved from the Hanko Console.http://localhost
redirects.App settings
> Basic
for your app.App ID
.Show
and copy the App Secret
.Settings
and select URLs
.
hanko-elements
web components, this should be the page containing the component to handle errors properly.
hanko-elements
applications, this should be the page containing the authentication component.
https://*.example.com
matches https://foo.example.com
and https://bar.example.com
.https://foo.example.com/*
matches URLs like https://foo.example.com/page1
and https://foo.example.com/page2
.Settings
and select Social connections
.Providers
section, find Facebook
and expand its configuration.App ID
as the Client ID
.App Secret
as the Client Secret
.Save
to apply your configuration.@teamhanko/hanko-elements
@teamhanko/hanko-frontend-sdk
<hanko-auth>
component from @teamhanko/hanko-elements
into your application. Once configured, the component will automatically display a Facebook sign-in button in the login interface.error redirect URL
as well as an
allowed redirect URL
(see the previous step).Unpublished
status, which limits its usage to developers and testers. To allow all users to authenticate with Facebook, you must submit your app for Facebook’s App Review process and get it approved for public use.