Skip to content

Signin with Apple platformsupport web/android #914

Closed

Description

@Isakdl

Signin with Apple works nicely for ios. But to have fullsupport on web and android the backend need to handle a callback URL from apple. Today we have not implemented this functionality.

Example endpoint, taken from sign_in_with_apple package example server.

// The callback route used for Android, which will send the callback parameters from Apple into the Android app.
// This is done using a deeplink, which will cause the Chrome Custom Tab to be dismissed and providing the parameters from Apple back to the app.
app.post("/callbacks/sign_in_with_apple", (request, response) => {
  const redirect = `intent://callback?${new URLSearchParams(
    request.body
  ).toString()}#Intent;package=${
    process.env.ANDROID_PACKAGE_IDENTIFIER
  };scheme=signinwithapple;end`;

  console.log(`Redirecting to ${redirect}`);

  response.redirect(307, redirect);
});

Full code

For web support we also have to expose the webAuthenticationOptions config object on the client. As this is needed to launch the sign in popup.

 var credential = await SignInWithApple.getAppleIDCredential(
      webAuthenticationOptions: WebAuthenticationOptions(
        clientId: 'com.example',
        redirectUri: Uri.https('example.com/callback/apple_sign_in_web'),
      ),
      scopes: [
        AppleIDAuthorizationScopes.email,
        AppleIDAuthorizationScopes.fullName,
      ],
    );

More info here:
https://pub.dev/packages/sign_in_with_apple

Activity

  1. added
    enhancement
    on May 15, 2023
  2. a1exhedb commented on Jan 4, 2024

    @a1exhedb

    Did you manage to get Apple login working on Android?
    I'm stuck on this exact same issue at the moment, and thinking of skipping this sign in option.

  3. Isakdl commented on Jan 4, 2024

    @Isakdl
    CollaboratorAuthor

    No this is yet to be implemented.

  4. FantaMagier commented on Aug 16, 2024

    @FantaMagier

    Any news on this Issue :D

  5. added
    area: authentication
    on Dec 18, 2024
  6. SandPod commented on Dec 18, 2024

    @SandPod
    Contributor

    Closing this as a duplicate of: #146

    Will link to this description in that issue so that the details can be preserved.

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

    area: authenticationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions