DEV Community

Discussion on: Implementing Facebook authentication with Devise for your Rails 6 app

Collapse
 
rhymes profile image
rhymes

Nice article Mbonu, such a coincidence BTW :-)

@joshpuetz has been working on adding optional Facebook authentication support to Forems in the following PR:

Log in with Facebook #9922

What type of PR is this? (check all applicable)

  • [ ] Refactor
  • [x] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

Adds support to logging into Forem with Facebook Oauth. We're only using the Omniauth Facebook provider, not Facebook's SDK. In addition: only the bare minimum amount of information is requested from Facebook, so no app review is required on their end (and we limit the amount of user data that we're asking for). Included is:

  • a new Authentication::Provider subclass
  • new environment variables
  • migrations to add fields to user
  • broadcast seed and production data
  • of COURSE tests

Related Tickets & Documents

resolves github.com/forem/InternalProjectPl...

QA Instructions, Screenshots, Recordings

DEV_local__Community_👩💻👨💻

Added tests?

  • [x] yes
  • [ ] no, because they aren't needed
  • [ ] no, because I need help

Added to documentation?

  • [x] docs.forem.com
  • [ ] readme
  • [ ] no documentation needed

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

The Facebook

The main difference in our approach is that we have a "one to many" correspondence between a user and the preferred login method. Something we call Identity. Thus a user can have a Twitter identity, a GitHub identity and so on.