Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DLVR-6993] merge upstream #3

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
54029c8
The new facebook api requires to pass along profile_fields. If this i…
smeevil Jul 7, 2017
1aea81a
Update dependencies and add Credo
doomspork Jul 18, 2017
54b03ff
Correct Credo complaints
doomspork Jul 18, 2017
9df852d
Update Travis matrix
doomspork Jul 18, 2017
d2583e2
Release 0.7.0
doomspork Jul 18, 2017
3fa42ab
Updates README.md with svg badge and new package version (#38)
sobolevn Aug 26, 2017
925ec34
Allow option to specify scheme for usar avatar url. Defaults to http …
jabberfest Mar 1, 2018
2b31d99
Stop ending empty params to the FB auth dialog (#46)
jbrowning Mar 9, 2019
e766e1f
Release 0.8
doomspork Mar 9, 2019
8428888
set oauth2 json library based on ueberauth's json library
taj Aug 5, 2019
a01a7c0
Merge pull request #48 from tajchumber/tc/oauth2-json-serializer
taj Aug 5, 2019
ea5da0f
Allow oauth2 library version 2.x
Aug 23, 2019
3919370
Merge pull request #49 from botsquad/allow-oauth2-2.0
yordis Aug 23, 2019
ee28811
allow oauth options to be configured from the conn
arghmeleg Feb 7, 2020
a351a25
Handle errors from fetching the access token with an invalid/expired …
jbrowning Feb 12, 2020
8824db7
also get options from conn here
arghmeleg Feb 14, 2020
c450ce4
Merge branch 'master' into allow-configs-from-conn
arghmeleg Feb 14, 2020
1835c0b
Release 0.8.1
Hanspagh Mar 2, 2020
9af6633
fix(*): Use type large for profile image (#54)
tonnenpinguin May 17, 2020
daa8201
Merge pull request #53 from arghmeleg/allow-configs-from-conn
Hanspagh Jun 22, 2020
015edf9
Add documenation for state
nbw Apr 12, 2021
b36429f
Update ex_doc
nbw Apr 12, 2021
e4426d3
Misc doc changes
kianmeng Apr 30, 2021
b57393f
Merge pull request #59 from kianmeng/misc-doc-changes
yordis May 1, 2021
24971a5
Fix crypto mac signature change in OTP/24
mtarnovan May 27, 2021
9a827ca
Merge pull request #61 from steady-media/fix/opt_24_crypto_hmac_depre…
yordis May 27, 2021
1bcc09f
Merge branch 'master' of github.com:ueberauth/ueberauth_facebook into…
nbw Jun 16, 2021
61361cd
undo deps update
Hanspagh Jun 17, 2021
499ca5a
Merge pull request #58 from nbw/feature/improved-docs
Hanspagh Jun 17, 2021
ff5fd66
Update version
yordis Jul 15, 2021
5322324
Require Ueberauth 0.7 and implement its CSRF protection
Oct 1, 2021
0e633bf
Merge pull request #65 from arjan/ueberauth-update
yordis Oct 2, 2021
d654575
chore: versioning and adding github actions
yordis Oct 2, 2021
3d5dab2
chore: fix credo
yordis Oct 2, 2021
ccacb4b
chore: fix ci
yordis Oct 2, 2021
fb44fb6
chore: fix name
yordis Oct 17, 2021
1b21547
Logging in detail
msaurabhee Apr 22, 2022
c841f11
Merge pull request #70 from msaurabhee/fix_issue_69
yordis May 5, 2022
a5bc822
Merge remote-tracking branch 'upstream/master' into DLVR-6993-merge-u…
maxp36 Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Order is important. The last matching pattern takes the most precedence.
# Default owners for everything in the repo.
* @ueberauth/developers
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Continuous Integration

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- 'master'
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'

- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests
run: mix test

Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'

- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Formatter
run: mix format --check-formatted

- name: Run Credo
run: mix credo
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Hexpm Release

on:
release:
types: [published]

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Hex Publish
run: mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
26 changes: 24 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
/_build
/deps
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
ueberauth_facebook-*.tar

# Temporary files for e.g. tests.
/tmp
21 changes: 15 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
language: elixir
elixir:
- 1.6
- 1.5
- 1.4
- 1.3
otp_release:
- 20.2
- 19.3
- 18.3
matrix:
include:
- otp_release: 18.3
elixir: 1.3.2
- otp_release: 19.0
elixir: 1.3.2
sudo: false
exclude:
- elixir: 1.6
otp_release: 18.3
- elixir: 1.3
otp_release: 20.2
script:
- mix test
- mix credo
60 changes: 49 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,83 @@
# v 0.6.0
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## v0.10.0 - 2021-09-23

* Allows errors from the provider to be thrown back to the user.

## v0.9.0 - 2021-09-23

* Require at least Ueberauth 0.7 due to changed builtin CSRF protection

## v0.8.2 - 2021-07-15

* Allow OAuth options to be configured from the connection
* Set default profile image to large

## v0.8.1 - 2020-03-02

* Handle errors from fetching the access token with an invalid/expired code
* Support OAuth2 version 2.0 library
* Set OAuth2 JSON library based on Ueberauth's JSON libray

## v0.8.0 - 2019-03-09

* Add option to specify scheme for user avatar URL
* Stop sending empty params to the Facebook auth dialog

## v0.7.0 - 2017-07-18

* Support `:appsecret_proof` parameter
* Set the required `:profile_fields` to get the email back

## v0.6.0 - 2016-12-27

* Support `:display` parameter
* Use OAuth2 0.8

# v 0.5.0
## v0.5.0 - 2016-09-21

* Pin OAuth2 to 0.6 to avoid errors

# v 0.4
## v0.4.0 - 2016-07-19

* Allow `:state` param to be configured

# v 0.3.2
## v0.3.2 - 2016-02-15

* Fix support for auth_type

# v 0.3.1
## v0.3.1 - 2016-02-10

* Add support for missing Locale parameter

# v 0.3.0
## v0.3.0 - 2016-02-04

* Add support for auth_type
* Support for additional request variables

# v 0.2.1
## v0.2.1 - 2015-12-11

* Add missing `profile_fields` parameter

# v 0.2.0
## v0.2.0 - 2015-11-28

* Release to follow the Ueberauth 0.2.0 release

# v 0.1.4
## v0.1.4 - 2015-11-18

* Added oauth2 and ueberauth to applications list

# v 0.1.1
## v0.1.1 - 2015-11-16

* Fixed character encoding errors in Hex package

# v 0.1.0
## v0.1.0 - 2015-11-16

* Initial strategy
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Ueberauth Facebook
# Contributing

## Pull Requests Welcome
1. Fork ueberauth_facebook
Expand Down
101 changes: 52 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Überauth Facebook
[![Build Status][travis-img]][travis] [![Hex Version][hex-img]][hex] [![License][license-img]][license]

[travis-img]: https://travis-ci.org/ueberauth/ueberauth_facebook.png?branch=master
[travis]: https://travis-ci.org/ueberauth/ueberauth_facebook
[hex-img]: https://img.shields.io/hexpm/v/ueberauth_facebook.svg
[hex]: https://hex.pm/packages/ueberauth_facebook
[license-img]: http://img.shields.io/badge/license-MIT-brightgreen.svg
[license]: http://opensource.org/licenses/MIT
[![Build Status](https://travis-ci.org/ueberauth/ueberauth_facebook.svg?branch=master)](https://travis-ci.org/ueberauth/ueberauth_facebook)
[![Module Version](https://img.shields.io/hexpm/v/ueberauth_facebook.svg)](https://hex.pm/packages/ueberauth_facebook)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ueberauth_facebook/)
[![Total Download](https://img.shields.io/hexpm/dt/ueberauth_facebook.svg)](https://hex.pm/packages/ueberauth_facebook)
[![License](https://img.shields.io/hexpm/l/ueberauth_facebook.svg)](https://github.com/ueberauth/ueberauth_facebook/blob/master/LICENSE)
[![Last Updated](https://img.shields.io/github/last-commit/ueberauth/ueberauth_facebook.svg)](https://github.com/ueberauth/ueberauth_facebook/commits/master)

> Facebook OAuth2 strategy for Überauth.

Expand All @@ -16,57 +15,61 @@

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

```elixir
def deps do
[{:ueberauth_facebook, "~> 0.6"}]
end
```
```elixir
def deps do
[
{:ueberauth_facebook, "~> 0.8"}
]
end
```

1. Add the strategy to your applications:

```elixir
def application do
[applications: [:ueberauth_facebook]]
end
```
```elixir
def application do
[
applications: [:ueberauth_facebook]
]
end
```

1. Add Facebook to your Überauth configuration:

```elixir
config :ueberauth, Ueberauth,
providers: [
facebook: {Ueberauth.Strategy.Facebook, []}
]
```
```elixir
config :ueberauth, Ueberauth,
providers: [
facebook: {Ueberauth.Strategy.Facebook, []}
]
```

1. Update your provider configuration:
1. Update your provider configuration:

```elixir
config :ueberauth, Ueberauth.Strategy.Facebook.OAuth,
client_id: System.get_env("FACEBOOK_CLIENT_ID"),
client_secret: System.get_env("FACEBOOK_CLIENT_SECRET")
```
```elixir
config :ueberauth, Ueberauth.Strategy.Facebook.OAuth,
client_id: System.get_env("FACEBOOK_CLIENT_ID"),
client_secret: System.get_env("FACEBOOK_CLIENT_SECRET")
```

1. Include the Überauth plug in your controller:
1. Include the Überauth plug in your controller:

```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controller
plug Ueberauth
...
end
```
```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controller
plug Ueberauth
...
end
```

1. Create the request and callback routes if you haven't already:
1. Create the request and callback routes if you haven't already:

```elixir
scope "/auth", MyApp do
pipe_through :browser
```elixir
scope "/auth", MyApp do
pipe_through :browser

get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```

1. Your controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.

Expand All @@ -78,7 +81,7 @@ Depending on the configured URL you can initialize the request through:

/auth/facebook

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

/auth/facebook?scope=email,public_profile

Expand Down Expand Up @@ -117,8 +120,8 @@ config :ueberauth, Ueberauth,

See [Graph API Reference > User](https://developers.facebook.com/docs/graph-api/reference/user) for full list of fields.

## Copyright and License

## License

Please see [LICENSE](https://github.com/ueberauth/ueberauth_facebook/blob/master/LICENSE) for licensing details.
Copyright (c) 2015 Sean Callan

Released under the MIT License, which can be found in the repository in [LICENSE](./LICENSE).
Loading
Loading