Skip to content

Spike: Meta as OAuth2 plus Graph profile, and the data deletion callback #4

Description

@ParallelEntrepreneur

Part of #1.

Blocked by: none. Blocks both Meta issues.

Problem. Facebook Login is OAuth 2.0 without OpenID Connect: there is no ID token, no discovery document, and the profile comes from a Graph API call. The openidconnect crate will not fit. Meta app review also requires a data deletion callback before the app can leave development mode.

Proposed approach.

  • Use the oauth2 crate (which openidconnect is built on) for the authorization-code exchange against https://www.facebook.com/v19.0/dialog/oauth and https://graph.facebook.com/v19.0/oauth/access_token, through the harness HttpClient port.
  • Profile step: GET https://graph.facebook.com/me?fields=id,name,email with the access token; email may be absent when the user has not verified one or declined the permission. Treat email as optional.
  • Verify the token belongs to our app with debug_token or by relying on the direct exchange; decide which.
  • Data deletion callback: Meta POSTs a signed_request (base64url payload plus HMAC-SHA256 with the app secret) with the user id; the endpoint must verify it, enqueue deletion, and respond with { url, confirmation_code } where url is a status page. Decide what "deletion" means here: unlink the Meta identity, and delete the user only if it has no other identity and no other data, otherwise anonymise the Meta identity.
  • Record what the app review submission needs from us: privacy policy URL, data deletion URL, the email and public_profile permissions.

Acceptance criteria

  • A scratch flow completing Facebook Login with a test app in wrangler dev
  • Written decision: oauth2 crate plus hand-rolled profile step, with the exact endpoints and fields
  • Written decision on what the deletion callback deletes and the confirmation flow
  • A signed_request verifier with a test vector
  • ADR recorded

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authshared authentication servicespiketime-boxed investigation with a written recommendation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions