Skip to content

feat: Adds support to Facebook Identity Provider - #4689

Merged
marcelomendoncasoares merged 7 commits into
serverpod:mainfrom
vfiruz97:feat/auth-facebook
Feb 18, 2026
Merged

marcelomendoncasoares merged 7 commits into
serverpod:mainfrom
vfiruz97:feat/auth-facebook

Conversation

@vfiruz97

@vfiruz97 vfiruz97 commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds Facebook OAuth authentication support to the serverpod_auth module. It implements a complete Facebook identity provider (IDP) with access token validation for enhanced security across all platforms.

Key features:

  • Facebook access token validation and authentication flow
  • Cross-platform support (iOS, Android, Web, macOS)
  • Customizable sign-in button widget with Facebook branding
  • Complete server-side token verification, user authentication, and account management
  • Integration with existing Serverpod auth system
  • Comprehensive test coverage

Dependencies added:

This PR adds one dependency to serverpod_auth_idp_flutter:

  • flutter_facebook_auth: ^7.1.5 - Popular Flutter package for Facebook authentication. Well-maintained with cross-platform support. This is the standard Flutter package for Facebook OAuth implementation that handles the native platform SDKs.

Note: On iOS, Facebook may issue limited access tokens when App Tracking Transparency (ATT) permission is not granted. These limited tokens cannot be validated by the server or used to retrieve user profile data, which will cause authentication to fail. Documentation will include a dedicated section on requesting ATT permissions to ensure full Facebook authentication functionality on iOS.

Demo:

A short video demonstration of Facebook Sign-In working across different platforms is available here: e2e test video

Fixes #147.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

None. This is a new feature that adds Facebook authentication support without modifying existing authentication methods or APIs.

@vfiruz97

vfiruz97 commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @marcelomendoncasoares,
This PR is ready for review. I followed the same pattern as other IDPs and rebased it on upstream/main to ensure smooth merging. I will proceed with the docs next.

@vfiruz97

vfiruz97 commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @marcelomendoncasoares,

Just checking in on this one! I know you're super busy, but whenever you have a moment, could you take a look?

Since it's closely aligned with our previous work on other IDPs, I'm hoping it'll be a fairly straightforward review. Thanks again for your time!

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work with more this provider, @vfiruz97! The main comment I have is the suggestion to decouple the flutter_facebook_auth from the main Flutter IDP package to avoid pushing too much platform-specific code onto users - which is not three-shaken and can create trouble building apps that does not use it.

@vfiruz97

Copy link
Copy Markdown
Contributor Author

Hi @marcelomendoncasoares, the comments are addressed.
There were some conflicts, which I resolved. As a result, I had to force-push the branch.
It’s now up to date with upstream/main. I also removed and recreated the Facebook migration to ensure it appears at the bottom in the correct order.

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes, @vfiruz97! And great implementation of the external registry. Only a couple last comments for improvement and we're good to go! 🚀

@vfiruz97

Copy link
Copy Markdown
Contributor Author

@marcelomendoncasoares, as always great suggestions! The comments are addressed. This is ready for another review.

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work with this provider, @vfiruz97! LGTM! 🚀

@vfiruz97

Copy link
Copy Markdown
Contributor Author

I'm addressing the issue discussed here: serverpod/serverpod_docs#418 (comment)
I made a small fix to FirebaseIdpConfigFromPasswords to accept additional optional parameters.

Since this PR is still open, I included the fix here. The remaining fixes will come in a separate PR from main.

Next, I'll review the Facebook docs according to the new guide style and request a review.

@marcelomendoncasoares
marcelomendoncasoares merged commit d5a18ac into serverpod:main Feb 18, 2026
141 of 142 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sign in with Facebook

2 participants