Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)

    May 4, 2026

    ‘This is fine’ creator says AI startup stole his art

    May 4, 2026

    Top announcements of the What’s Next with AWS, 2026

    May 3, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)
    iOS Development

    Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)

    big tee tech hubBy big tee tech hubMay 4, 2026002 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I’m implementing Sign in with Apple on iOS using Flutter + Firebase Auth. Apple returns a valid token but Firebase rejects it with:

    firebase_auth/invalid-credential — Invalid OAuth response from apple.com
    

    Environment:

    • firebase_core: 4.6.0

    • firebase_auth: 6.3.0

    • sign_in_with_apple: 7.0.1

    • Flutter (latest stable)

    • iOS deployment target: 16.0

    • Testing on physical device via TestFlight (not simulator)

    Flutter code (auth_service.dart):

    final rawNonce = _generateNonce();
    final nonce = _sha256ofString(rawNonce);
    
    final appleCredential = await SignInWithApple.getAppleIDCredential(
      scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName],
      nonce: nonce,
    );
    
    final oauthCredential = OAuthProvider('apple.com').credential(
      idToken: appleCredential.identityToken,
      rawNonce: rawNonce,
    );
    
    return await _auth.signInWithCredential(oauthCredential);
    

    Nonce generation:

    String _generateNonce([int length = 32]) {
      const charset="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._";
      final random = Random.secure();
      return List.generate(length, (_) => charset[random.nextInt(charset.length)])
          .join();
    }
    
    String _sha256ofString(String input) {
      final bytes = utf8.encode(input);
      final digest = sha256.convert(bytes);
      return digest.toString();
    }
    

    Verified on-device — token claims decoded and confirmed correct:

    • iss:

    • aud: matches bundle ID exactly

    • nonce: present, correctly SHA-256 hashed

    • exp: not expired

    • email_verified: true

    • nonce_supported: true

    Apple Developer config — all verified correct:

    • App ID has Sign in with Apple enabled as Primary App ID

    • Services ID configured with correct Firebase return URL (https://.firebaseapp.com/__/auth/handler)

    • Key registered with SIWA capability, associated with correct Primary App ID

    • Team ID confirmed in Apple Developer → Membership

    What I’ve tried:

    • Deleted and re-added the Firebase Apple provider from scratch

    • Re-pasted the .p8 key multiple times via different methods

    • Generated a brand new key and updated Firebase — error persists

    • Tried bundle ID in the Services ID field instead of Services ID — no change

    • GCP audit logs show 0 results for identitytoolkit — cannot see server-side rejection reason

    Email/password sign-in works fine on the same project. The rejection happens server-side inside Firebase Auth — Apple’s side is confirmed correct.

    Has anyone seen Firebase reject a valid Apple token with this error? Is there a known project-level misconfiguration that isn’t visible from the console?

    Any pointers appreciated! Have spent over 6 hours on this already… TIA



    Source link

    Apple Firebase Flutter invalidcredential iOS returns Sign token valid
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    An Interpreter for Swift | Cocoanetics

    May 3, 2026

    Apple reports second quarter results

    May 2, 2026

    Replit’s Amjad Masad on the Cursor deal, fighting Apple, and why he’d rather not sell

    May 2, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)

    May 4, 2026

    ‘This is fine’ creator says AI startup stole his art

    May 4, 2026

    Top announcements of the What’s Next with AWS, 2026

    May 3, 2026

    Tim Cook’s Legacy + The Future of U.B.I.

    May 3, 2026
    Timer Code
    15 Second Timer for Articles
    20
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    Firebase Sign in with Apple returns invalid-credential despite valid Apple token (Flutter iOS)

    May 4, 2026

    ‘This is fine’ creator says AI startup stole his art

    May 4, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.