This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Update documentation for configuring facebook login #11755
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Update documentation for configuring login with facebook. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,9 +390,6 @@ oidc_providers: | |
|
||
|
||
Like Github, Facebook provide a custom OAuth2 API rather than an OIDC-compliant | ||
one so requires a little more configuration. | ||
|
||
0. You will need a Facebook developer account. You can register for one | ||
[here](https://developers.facebook.com/async/registration/). | ||
1. On the [apps](https://developers.facebook.com/apps/) page of the developer | ||
|
@@ -412,24 +409,28 @@ Synapse config: | |
idp_name: Facebook | ||
idp_brand: "facebook" # optional: styling hint for clients | ||
discover: false | ||
issuer: "https://facebook.com" | ||
issuer: "https://www.facebook.com" | ||
client_id: "your-client-id" # TO BE FILLED | ||
client_secret: "your-client-secret" # TO BE FILLED | ||
scopes: ["openid", "email"] | ||
authorization_endpoint: https://facebook.com/dialog/oauth | ||
token_endpoint: https://graph.facebook.com/v9.0/oauth/access_token | ||
user_profile_method: "userinfo_endpoint" | ||
userinfo_endpoint: "https://graph.facebook.com/v9.0/me?fields=id,name,email,picture" | ||
authorization_endpoint: "https://facebook.com/dialog/oauth" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we quoting values here just for consistency? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty much, yes. |
||
token_endpoint: "https://graph.facebook.com/v9.0/oauth/access_token" | ||
jwks_uri: "https://www.facebook.com/.well-known/oauth/openid/jwks/" | ||
user_mapping_provider: | ||
config: | ||
subject_claim: "id" | ||
display_name_template: "{{ user.name }}" | ||
email_template: "{{ '{{ user.email }}' }}" | ||
``` | ||
|
||
Relevant documents: | ||
* https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow | ||
* Using Facebook's Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/ | ||
* Reference to the User endpoint: https://developers.facebook.com/docs/graph-api/reference/user | ||
* [Manually Build a Login Flow](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow) | ||
* [Using Facebook's Graph API](https://developers.facebook.com/docs/graph-api/using-graph-api/) | ||
* [Reference to the User endpoint](https://developers.facebook.com/docs/graph-api/reference/user) | ||
|
||
Facebook do have an [OIDC discovery endpoint](https://www.facebook.com/.well-known/openid-configuration), | ||
but it has a `response_types_supported` which excludes "code" (which we rely on, and | ||
is even mentioned in their [documentation](https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login)), | ||
so we have to disable discovery and configure the URIs manually. | ||
|
||
### Gitea | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is nearly oidc-compliant now; the difference is spelt out more clearly in the text about discovery at the end.