Coder Social home page Coder Social logo

Comments (4)

tp avatar tp commented on July 18, 2024 1

Expecting non null value for userIdentifier.

Note it's only happens on web.

@trust2065 hmm, can not say whether that would be a bug, or whether your expectation is wrong here.

The comment says that

/// This will always be provided on iOS and macOS systems. On Android, however, this will not be present.

I would wager that the same limitation from Android also applies to the web (as both use a web-based flow), though I can't say for sure as I haven't debugged this in a while.

What do you want to do with it anyway? Upon receiving the credential, one should take the authorizationCode and retrieve the details from Apple's servers which will give you a stable user identifier.

from dart_packages.

tp avatar tp commented on July 18, 2024 1

Could you please point out where the limitation you mentioned

/// This will always be provided on iOS and macOS systems. On Android, however, this will not be present.

is written?

/// An identifier associated with the authenticated user.
///
/// This will always be provided on iOS and macOS systems. On Android, however, this will not be present.
/// This will stay the same between sign ins, until the user deauthorizes your App.
final String? userIdentifier;

Even if I want to send to my server, the returned credential is an empty object.

Are you sure it's fully empty?

From your report above it seems you're using an older version, that still logs as AuthorizationAppleID (see

return 'AuthorizationAppleID($userIdentifier, $givenName, $familyName, $email, $state)';
), whereas the latest version logs the object (correctly) as AuthorizationCredentialAppleID.

This latest toString fix also makes it clear now that the identityToken value is not printed (too verbose and sensitive;

return 'AuthorizationCredentialAppleID($userIdentifier, $givenName, $familyName, $email, [identityToken set: ${identityToken != null}], $state)';
). But that is exactly the value you should continue working with here :)

from dart_packages.

trust2065 avatar trust2065 commented on July 18, 2024 1

Thanks! Now I'm able to get userID, much appreciated for answering this :)

To conclude the topic

  • So your point is correct, the web is acting like Android, userIdentifier will not be returned in SignInWithApple.getAppleIDCredential.

When printing the return value, it does not print the authorizationCode, therefore I thought it does not included. By printing credentail.authorizationCode we will see the value.

The next step is use the code to exchange user information from apple server. just like how https://pub.dev/packages/sign_in_with_apple/example do.

I'm using Node.js so one can utilise https://github.com/ananay/apple-auth
Be awarded that the document is a bit outdated. If anyone got 404 from the apple server, find ananay/apple-auth#31 to help to debug.

from dart_packages.

trust2065 avatar trust2065 commented on July 18, 2024

@tp What I am trying to do is use the userIdentifier as the id for each user in my member system. Therefore in my current implementation there is no follow up sending to server actions. Could you please point out where the limitation you mentioned

/// This will always be provided on iOS and macOS systems. On Android, however, this will not be present.

is written?

Even if I want to send to my server, the returned credential is an empty object. Would that make sense to send empty object and expect receive valuable return values?

from dart_packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.