Class AppleSignInResult

java.lang.Object
com.codename1.social.AppleSignInResult

public final class AppleSignInResult extends Object

Successful outcome of an AppleSignIn.signIn(String, AppleSignInCallback) call.

Apple only returns the user's name and email on the first authorization for a given app. On subsequent sign-ins those fields are absent in the native callback; AppleSignIn backfills them from Preferences when present, so the application sees a consistent result.

  • Method Summary

    Modifier and Type
    Method
    Description
    Authorization code suitable for the server-side client_secret token exchange (Apple does not expose refresh tokens to public clients, so this is the only way to obtain one).
    Email the user shared with the app.
    Full display name (given + family) on the first authorization; previously-stored value otherwise; null if the user declined to share it.
    JWT identity token signed by Apple.
    The nonce this sign-in sent, before hashing: the native sheet sends Apple its SHA-256, so the identity token's nonce claim is that hash, and a service that checks the token against the request -- Firebase Authentication's signInWithIdp -- needs this value to recompute it.
    Stable opaque identifier ("user identifier" in Apple's docs).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getIdentityToken

      public String getIdentityToken()
      JWT identity token signed by Apple. Send to your backend, where you must validate the signature against Apple's JWKS and check the aud / iss / exp claims before trusting it.
    • getAuthorizationCode

      public String getAuthorizationCode()
      Authorization code suitable for the server-side client_secret token exchange (Apple does not expose refresh tokens to public clients, so this is the only way to obtain one).
    • getUserId

      public String getUserId()
      Stable opaque identifier ("user identifier" in Apple's docs). Treat this as the user's primary key for your app.
    • getEmail

      public String getEmail()
      Email the user shared with the app. May be the real address, may be a relay address (@privaterelay.appleid.com), or may be null if the user has previously signed in and the email was already stored.
    • getFullName

      public String getFullName()
      Full display name (given + family) on the first authorization; previously-stored value otherwise; null if the user declined to share it.
    • getRawNonce

      public String getRawNonce()
      The nonce this sign-in sent, before hashing: the native sheet sends Apple its SHA-256, so the identity token's nonce claim is that hash, and a service that checks the token against the request -- Firebase Authentication's signInWithIdp -- needs this value to recompute it. null for the web flow, whose request carries an unhashed nonce of its own.