Skip to content

Commit

Permalink
Merge 83c3fa6 into 9c3bf63
Browse files Browse the repository at this point in the history
  • Loading branch information
smancke committed Jan 3, 2019
2 parents 9c3bf63 + 83c3fa6 commit 620a972
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -301,9 +301,9 @@ The OAuth Web Flow (aka 3-legged-OAuth flow) is also supported.
Currently the following OAuth provider is supported:

* GitHub
* Google (see note below)
* Google
* Bitbucket
* Facebook (see note below)
* Facebook
* Gitlab

An OAuth provider supports the following parameters:
Expand All @@ -324,9 +324,6 @@ if loginsrv is routed through a reverse proxy, if the headers `X-Forwarded-Host`
$ docker run -p 80:80 tarent/loginsrv -github client_id=xxx,client_secret=yyy
```

### Note for Facebook's OAuth 2
Make sure you ask for the scope `email` when adding your Facebook config option. Otherwise the provider won't be able to fetch the user's email.

## Templating

A custom template can be supplied by the parameter `template`.
Expand Down
7 changes: 4 additions & 3 deletions oauth2/facebook.go
Expand Up @@ -29,9 +29,10 @@ type facebookUser struct {
}

var providerfacebook = Provider{
Name: "facebook",
AuthURL: "https://www.facebook.com/v2.12/dialog/oauth",
TokenURL: "https://graph.facebook.com/v2.12/oauth/access_token",
Name: "facebook",
AuthURL: "https://www.facebook.com/v2.12/dialog/oauth",
TokenURL: "https://graph.facebook.com/v2.12/oauth/access_token",
DefaultScopes: "email",
GetUserInfo: func(token TokenInfo) (model.UserInfo, string, error) {
fu := facebookUser{}

Expand Down

0 comments on commit 620a972

Please sign in to comment.