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

docs: clarify facebook graph API versioning #4208

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions selfservice/strategy/oidc/provider_facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func (g *ProviderFacebook) Claims(ctx context.Context, token *oauth2.Token, quer
}

appSecretProof := g.generateAppSecretProof(token)
// Do not use the versioned Graph API here. If you do, it will break once the version is deprecated. See also:
//
// When you use https://graph.facebook.com/me without specifying a version, Facebook defaults to the oldest
// available version your app supports. This behavior ensures backward compatibility but can lead to unintended
// issues if that version becomes deprecated.
u, err := url.Parse(fmt.Sprintf("https://graph.facebook.com/me?fields=id,name,first_name,last_name,middle_name,email,picture,birthday,gender&appsecret_proof=%s", appSecretProof))
if err != nil {
return nil, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("%s", err))
Expand Down
Loading