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

Support Facebook as OIDC Provider #1034

Closed
qvamatel opened this issue Feb 4, 2021 · 0 comments
Closed

Support Facebook as OIDC Provider #1034

qvamatel opened this issue Feb 4, 2021 · 0 comments
Labels
bug Something is not working. feat New feature or request.

Comments

@qvamatel
Copy link
Contributor

qvamatel commented Feb 4, 2021

Is your feature request related to a problem? Please describe.

Because there is no facebook provider, I attempted to integrate with Facebook using the generic oidc provider like so:

...
oidc:
  enabled: true
  config:
    providers:
      - id: facebook
        provider: generic
        mapper_url: file:///etc/config/kratos/oidc.facebook.jsonnet
        client_id: ID
        client_secret: SECRET
        scope:
          - openid
          - email
        issuer_url: https://facebook.com
        auth_url: https://facebook.com/dialog/oauth
        token_url: https://graph.facebook.com/oauth/access_token
...

with oidc.facebook.jsonnet containing

local claims = std.extVar('claims');

{
  identity: {
    traits: {
      name: claims.name,
      [if "email" in claims then "email" else null]: claims.email,
    },
  },
}

Because facebook uses its own solution and does not fully support to OpenID Connect Discovery, so kratos runs on error, like:

https://community.ory.sh/t/kratos-facebook-sso/1748

Describe the solution you'd like

Requires a facebook provider similar to the github provider: #519

Describe alternatives you've considered

I'll open a draft pull request shortly with what I was able to get working.

I worked with the following documentations:

https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

https://developers.facebook.com/docs/graph-api/reference/user

@aeneasr aeneasr added bug Something is not working. feat New feature or request. labels Feb 5, 2021
@aeneasr aeneasr closed this as completed in 905bb03 Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. feat New feature or request.
Projects
None yet
Development

No branches or pull requests

2 participants