All Projects → ueberauth → ueberauth_facebook

ueberauth / ueberauth_facebook

Licence: MIT License
Facebook OAuth2 Strategy for Überauth.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to ueberauth facebook

ueberauth slack
Slack OAuth2 Strategy for Überauth
Stars: ✭ 23 (-68.06%)
Mutual labels:  oauth, strategy, ueberauth, ueberauth-strategies
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.
Stars: ✭ 1,026 (+1325%)
Mutual labels:  oauth, oauth2, facebook
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+366.67%)
Mutual labels:  oauth, oauth2, facebook
Ueberauth github
GitHub OAuth2 Strategy for Überauth
Stars: ✭ 80 (+11.11%)
Mutual labels:  oauth, oauth2, strategy
Ueberauth google
Google OAuth2 Strategy for Überauth.
Stars: ✭ 110 (+52.78%)
Mutual labels:  oauth, oauth2, strategy
Auth
:atom: Social (OAuth1\OAuth2\OpenID\OpenIDConnect) sign with PHP
Stars: ✭ 457 (+534.72%)
Mutual labels:  oauth, oauth2, facebook
Assent
Multi-provider framework in Elixir
Stars: ✭ 126 (+75%)
Mutual labels:  oauth, oauth2, facebook
Pow assent
Multi-provider authentication for your Pow enabled app
Stars: ✭ 236 (+227.78%)
Mutual labels:  oauth, oauth2, facebook
IdentityServer4.PhoneNumberAuth
Sample passwordless phone number authentication using OAuth in ASP.NET Core 2.2
Stars: ✭ 83 (+15.28%)
Mutual labels:  oauth, oauth2
lumen-oauth2
OAuth2 module for the Lumen PHP framework.
Stars: ✭ 29 (-59.72%)
Mutual labels:  oauth, oauth2
VKontakte
[READ ONLY] Subtree split of the SocialiteProviders/VKontakte Provider (see SocialiteProviders/Providers)
Stars: ✭ 82 (+13.89%)
Mutual labels:  oauth, oauth2
oauth2-server
A spec compliant, secure by default PHP OAuth 2.0 Server
Stars: ✭ 6,128 (+8411.11%)
Mutual labels:  oauth, oauth2
ueberauth discord
Discord OAuth2 Strategy for Überauth.
Stars: ✭ 12 (-83.33%)
Mutual labels:  oauth2, ueberauth
yii-auth-client
Yii Framework external authentication via OAuth and OpenID Extension
Stars: ✭ 20 (-72.22%)
Mutual labels:  oauth, oauth2
Twitch
[READ ONLY] Subtree split of the SocialiteProviders/Twitch Provider (see SocialiteProviders/Providers)
Stars: ✭ 20 (-72.22%)
Mutual labels:  oauth, oauth2
Spotify
[READ ONLY] Subtree split of the SocialiteProviders/Spotify Provider (see SocialiteProviders/Providers)
Stars: ✭ 13 (-81.94%)
Mutual labels:  oauth, oauth2
AzureADAuthRazorUiServiceApiCertificate
Azure AD flows using ASP.NET Core and Microsoft.Identity
Stars: ✭ 41 (-43.06%)
Mutual labels:  oauth, oauth2
OAuthLogin.AspNetCore
第三方平台联合登陆(facebook、微信、微博、QQ、Kakao)
Stars: ✭ 43 (-40.28%)
Mutual labels:  oauth2, facebook
oauthproxy
This is an oauth2 proxy server
Stars: ✭ 32 (-55.56%)
Mutual labels:  oauth, oauth2
goth fiber
Package goth_fiber provides a simple, clean, and idiomatic way to write authentication packages for fiber framework applications.
Stars: ✭ 26 (-63.89%)
Mutual labels:  oauth, oauth2

Überauth Facebook

Build Status Module Version Hex Docs Total Download License Last Updated

Facebook OAuth2 strategy for Überauth.

Installation

  1. Setup your application at Facebook Developers.

  2. Add :ueberauth_facebook to your list of dependencies in mix.exs:

    def deps do
      [
        {:ueberauth_facebook, "~> 0.8"}
      ]
    end
  3. Add the strategy to your applications:

    def application do
      [
        applications: [:ueberauth_facebook]
      ]
    end
  4. Add Facebook to your Überauth configuration:

    config :ueberauth, Ueberauth,
      providers: [
        facebook: {Ueberauth.Strategy.Facebook, []}
      ]
  5. Update your provider configuration:

    config :ueberauth, Ueberauth.Strategy.Facebook.OAuth,
      client_id: System.get_env("FACEBOOK_CLIENT_ID"),
      client_secret: System.get_env("FACEBOOK_CLIENT_SECRET")
  6. Include the Überauth plug in your controller:

    defmodule MyApp.AuthController do
      use MyApp.Web, :controller
      plug Ueberauth
      ...
    end
  7. Create the request and callback routes if you haven't already:

    scope "/auth", MyApp do
      pipe_through :browser
    
      get "/:provider", AuthController, :request
      get "/:provider/callback", AuthController, :callback
    end
  8. Your controller needs to implement callbacks to deal with Ueberauth.Auth and Ueberauth.Failure responses.

For an example implementation see the Überauth Example application.

Calling

Depending on the configured URL you can initialize the request through:

/auth/facebook

Or with options (auth_type, scope, locale, display):

/auth/facebook?scope=email,public_profile

By default the requested scope is "public_profile". Scope can be configured either explicitly as a scope query value on the request path or in your configuration:

config :ueberauth, Ueberauth,
  providers: [
    facebook: {Ueberauth.Strategy.Facebook, [default_scope: "email,public_profile,user_friends"]}
  ]

Additionally you can now specify the display param to pass to Facebook:

config :ueberauth, Ueberauth,
  providers: [
    facebook: {Ueberauth.Strategy.Facebook, [
      default_scope: "email,public_profile,user_friends",
      display: "popup"
    ]}
  ]

display can be the following values: page (default), async, iframe, popup, touch, wap

Starting with Graph API version 2.4, Facebook has limited the default fields returned when fetching the user profile. Fields can be explicitly requested using the profile_fields option:

config :ueberauth, Ueberauth,
  providers: [
    facebook: {Ueberauth.Strategy.Facebook, [profile_fields: "name,email,first_name,last_name"]}
  ]

See Graph API Reference > User for full list of fields.

Copyright and License

Copyright (c) 2015 Sean Callan

Released under the MIT License, which can be found in the repository in LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].