Hello fellow developers,
My team has been running into a persistent INVALID_CLIENT error while trying to implement Sign In With Apple JS in our Nextjs app with signInWithPopup from firebase/auth. Here is the full error:
Error getting access token from https://appleid.apple.com, OAuth2 redirect uri is: https://[redacted]/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, crossOriginEmbedderPolicy=null, crossOriginOpenerPolicy=null, crossOriginResourcePolicy=null, permissionsPolicies=[], headers=HTTP/1.1 200 OK, contentSecurityPolicies=[], originTrials=[], reportToHeaders=[], varyHeaderNames=[], cookieList=[]}}
I've checked every thread on these forums and stackoverflow for solutions to this very common issue, and we tried them all. We made sure to verify that the Services ID, Apple Team ID, Key ID and Private key are all correctly used in the firebase console, we have regenerated our keys, all to no avail.
We also contacted Apple Support via the Development And Technical option with Certificates, Identifiers, and Provisioning Profiles topics, but they directed us to code-level support, which excludes 3rd Party libraries so this does not seem appropriate for us.
Does anyone have any idea of what might be wrong or suggestions for something we could try? We are able to get the pop up to open with an Apple login form, allow us to enter the credentials, but then when we hit continue the error occurs.
We are using firebase version ^10.4.0
Any help would be greatly appreciated and let me know if I need to provide any additional info. Thank you.
Sign in with Apple JS
RSS for tagProvide users with a fast, secure way to sign into your web service with their Apple ID using Sign in with Apple JS.
Posts under Sign in with Apple JS tag
42 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello Developers,
I have ran into a problem while sending mail to apple private relay email. We have built a mobile application where user can sign up through apple and they can sign up using hide-my-email feature. Which provides private relay address for us. Now we want to communicate with them using private relay mail address. The technology we are using to send emails are amazon SES, have done SPF, DMIK, DMARC and added domains in apple identity services for mail communication, passed an SPF check as well. But still mail is not getting delivered
what am i doing wrong or apple doesn't support third party apps for sending emails to private relay? Is there any other way to achieve this please let me know
Using the same body as attached in image is working fine for rest emails.
Topic:
Privacy & Security
SubTopic:
General
Tags:
Sign in with Apple REST API
Privacy
Sign in with Apple
Sign in with Apple JS
https://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens/
As shown in the documentation, when I tested via curl, I received a response with status 200, but when I logged in to account.apple.com with the linked account, it shows that it is still connected.
I would like to know if there is any additional way to verify that the revoke api is working properly.
Topic:
App & System Services
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
We are developing a captive portal for a community Wi-Fi service that will be deployed to thousands of locations around the world. The service is a paid service that sells Wi-Fi connectivity by data volume rather than time. We want to enable our customers to Sign in with Apple without giving them full internet access until they have made a purchase. This requires us to whitelist domains and URLs to make this work.
Where can I find a complete list of domains that are required for Sign in with Apple to function correctly? It’s not possible for us to whitelist *.apple.com because that results in significant (free) background network traffic during the sign in process. So far we have whitelisted:
account.apple.com
appleid.apple.com
appleid.apple-cdn.com
idmsa.apple.com
gsa.apple.com
mzstatic.com
Our customers are still having issues with Sign in with Apple while interacting with our captive portal in the iOS pseudo browser. How can we debug this because we cannot use the Safari developer tools with the pseudo browser. Are there any logs when doing this on a Mac that we can check in the Console?
If we kick the user out to Safari then they are able to complete the Sign in with Apple process, but that is not the user experience we want.
Topic:
Privacy & Security
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
E aí pessoal, tudo certo?
Estou desenvolvendo um app com React Native no front-end e Node.js no back-end, usando o Firebase como banco de dados (e possivelmente para autenticação também, dependendo da solução). Preciso implementar o "Sign in with Apple" e estou com algumas dúvidas em como integrar tudo isso.
A ideia é: o usuário clica no botão "Entrar com a Apple" no app (React Native), o backend (Node.js) processa a autenticação com a Apple e, em seguida, armazena as informações necessárias (nome, email, etc.) no Firebase.
Se alguém já trabalhou com essa combinação (React Native, Node.js, Firebase e Sign in with Apple) e puder compartilhar alguma experiência, dicas, exemplos de código ou até mesmo um boilerplate, seria de grande ajuda!
Hello
We would like to proceed with the transfer of ownership of the launched app based on the Cafe24 platform.(Web App)
Last month, I inquired about how to transfer the Apple account login function together when transferring ownership and received a related manual.
When I asked and inquired about help from several developers regarding that part, they all received different answers.
Please review the answers below, and I would really appreciate it if you could guide me on how to proceed.
Developer 1: Cafe24-based launch apps require a separate transfer of the login function. It does not affect if you do not delete the existing member data in the database, and you only need to activate the login function to the new developer account.
Developer 2: Checking and analyzing existing servers and data - Transfer user data to Apple using Apple's Legacy User Identifier - Synchronize user data - Test and modify
It has to proceed to the above four steps, and synchronization work is also required to maintain all of the existing user's data because all of the user's identification values change when the login function is transferred.
Developer 3: It appears to be a task that needs to be stored in the server database by migrating from the user identifier created in the existing developer account to the user identifier to be used in the new developer account, which is not what the app is supposed to do, and it is recommended to find other experts.
Thank you.
In response to inquiries from users, we have confirmed the following phenomenon.
If you select "Private email address" in the flow of new user registration with Apple ID, you will not receive the verification code email when performing two-factor authentication.
■User impact
If you use your Apple ID to link an external account without making your email address public, you will not receive the authentication code during two-factor authentication and will not be able to proceed. The date and time of the impact is currently unknown.
◎Impact 1: New registration
If you select "Private email address" in the flow of registering a new user with Apple ID, the verification code will not be received during two-factor authentication and registration will not be completed.
◎Impact 2: Login of existing account
When two-factor authentication is required for an existing account registered with Apple ID set to "Private email address," the verification code is not received and the user cannot log in.
→If you have not registered a login method other than Apple ID for the relevant account, there is no other way to log in.
■About workarounds
・I thought that I could avoid this issue by canceling the private setting of my Apple ID, but I was unable to do so.
→There is currently no workaround found for existing users who are experiencing this issue.
・However, the scope of influence is limited.
■Cause investigation status
Premise: For an Apple ID whose email address is not made public, the two-factor authentication authentication code email follows the following route.
①CDC/GIGYA
miraiz-persol.jp (SendGrid)
Apple's email server (relay server to hide the user's real email address)
User mailbox
→Since '1' are working, the problem seems to have occurred after the connection from ② or ③.
(At this stage, we cannot determine who is at fault: the user, MIRAIZ, or Apple. We are currently investigating.)
◎Hypothesis
・Is there something wrong with Apple's mail server?
・Is it not delivered because the user's mailbox is full?
■Questions, research, and responses we would like to receive
Please check the following two points and reply.
1st point
As shown in the attached image, there seems to be no problem with the SPF settings.
Is it possible to check to see if any errors have occurred with Apple's mail server?
2nd point
Are there any cases where you still can't receive emails even if you deactivate your Apple ID?
I would like to know if there are any patterns in which emails are not being delivered in terms of past inquiries or overall specifications
Topic:
Privacy & Security
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
We have 2 developers:
Developer A created a Bundle ID and configured Sign in with Apple, but didn't create a corresponding App. This Bundle ID is only used for login on our official website.
Developer B created a Bundle ID, configured Sign in with Apple, and has a corresponding App.
The issue we're encountering is that because these two Bundle IDs are under different teams, when using the same Apple ID to log into these two applications, different accounts are generated. (We've tested that when creating Service IDs under the same team, logging in with Bundle IDs under the same team generates the same account.)
Since Developer A's Bundle ID doesn't have a created app, it cannot be transferred to Developer B. Therefore, we'd like to know if there's any way to make the accounts generated from logging in with the same Apple ID be identical across these two teams?
Topic:
Privacy & Security
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
Context
We are experiencing inconsistent behaviour with "Sign in with Apple" across different environments (we have an app for "A" and "B" regions) on our web client in browsers.
Specifically, we have observed two key issues:
Missing email and email_verified Claims in ID Token
In some cases, the ID token received after successful authentication does not contain the email and email_verified claims.
Here the docs state that "Alternatively, if the managed Apple ID is in Apple School Manager, the email claim may be empty. Students, for example, often don’t have an email that the school issues.", but this was experienced with a non-student Apple ID.
This issue was observed for certain users in the "A" environment, while the same users had no issues in the "B" environment.
For one affected user, removing and re-enabling the "Sign in with Apple" integration resolved the issue (https://account.apple.com/account/manage/section/security).
However, for another user, the integration could not be removed, preventing this workaround (button was active, but did nothing).
In contrast, for some users, authentication works correctly in both environments without missing claims.
Inconsistent Display of App Icon and App Name
The app icon and app name do not always appear on the Apple login interface.
One user observed that the app icon and name were displayed in "A" but not in "B".
Another user had the opposite experience, with the app icon and name appearing in "B" but not in "A".
A third user did not see the app icon or name in either environment.
Questions
Why does the app icon and name not always appear on the "Sign in with Apple" login screen?
How is it possible that the ID token sometimes lacks email and email_verified claims when using the same Apple ID in different environments?
Hi everyone,
My web application has two services: myapp.com and account.myapp.com.
The first manages all app content, while the latter handles the authentication, with Sign In with Apple included.
The tech stack is mainly composed of React, JS, and Express.
We'd like to allow users to authenticate inside a dialog on some pages of myapp.com.
To avoid replicating stuff from one service to another, we put an iframe inside the dialog to show the authentication standard page from account.myapp.com.
Email and Facebook processes work fine, but we have the following issues with Sign in with Apple:
On desktop, not Safari, a pop-up window opens when you click on the Apple button, and it works as expected.
On desktop Safari, the pop-up window is blocked. We want the native Apple pop-up to show instead of a generic browser new window.
On mobile, nothing happens on click
Obviously, outside the iframe, everything works as expected.
I can't seem to find anything related to an iframe constraint in the Sign in with Apple docs. Is this feasible?
Topic:
Safari & Web
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
Hi, preivously on appleid.apple.com, navigating to this page on safari would show the in-app modal to continue with Apple.
Now with account.apple.com, this is not the case. We are not seeing the in-app modal to continue with Apple
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
I am trying to implement Apple Login on the web.
The language I am using is PHP.
I have created the App ID, Service ID, and Key.
In the Service ID, I clicked the Configure button for Sign In With Apple and entered the domain and return URL.
However, when I click the login button, I only get an "invalid_client" error screen.
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
My app was rejected from App Store because of the following reasons:
This item has been rejected for the following reasons:
2.1.0 Performance: App Completeness
4.8.0 Design: Login Services
I implemented and upgraded the app with these updates. However, the app is working fine on the test side, but it shows an error when I try to upload the app for review again.
Please advise my next steps.
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
When implementing Sign In with Apple I created an App ID and a Service ID for my app. I didn't configure the Server-to-Server Notification URL properly there and token revocation didn't work.
Later on I updated the url config and the name of the identifiers. However, when I Sign in with Apple in my app I still see the old identifier name in my iPhone Settings->Apple Account->Sign in with Apple. I would assume that if the name doesn't update, the configuration doesn't update either.
I'm using automatic Xcode signing, I have deleted all the profiles locally, cleaned project, bumped versions, waited for a week, nothing worked.
Token revocation for account deletion doesn't work properly I would assume because of the initial misconfiguration. I want to mention that this is working fine for my development build (another bundleID, AppID, ServiceID)
What am I missing here?
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
I'm currently facing an issue while integrating Sign in with Apple on a Firebase web app using JavaScript.
✅ What I’ve done:
Created a Service ID
Created an App ID and enabled Sign in with Apple
Linked the Service ID to the App ID under Web Authentication Configuration and also add these
Domains and sub-domains: apple-signin-test-next.firebaseapp.com
Registered return URL: https://apple-signin-test-next.firebaseapp.com/__/auth/handler
Generated a key with Sign in with Apple capability and added:
Key ID
Team ID
Private Key
Client ID (Service ID not App ID)
all in the Firebase Auth Apple Sign-In configuration
I’ve tried multiple test projects and keys, including deleting and recreating everything, but I still consistently receive this error:
invalid_client
🔎 Additional Details:
The client_id in the auth request matches the Service ID exactly
I’m not using an iOS app — this is purely web-based Sign in with Apple
I am using a valid Apple Developer account enrolled in the program
What could be the reason Apple keeps returning invalid_client even though all configuration seems correct?
Please help us to resolve the issue.
We are ready to connect for a call too.
Thanks
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Sign in with Apple
Sign in with Apple JS
We’re integrating Sign in with Apple using Apple’s official JavaScript SDK:
https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js
We’ve successfully used this setup with an older Service ID, but when we try to use any newly created Service ID, we get the following error immediately when calling AppleID.auth.signIn():
invalid_client
This happens before any request reaches our backend. The same flow, redirect URI, and frontend code works fine with an old Service ID — but fails with new ones.
✅ What We’ve Verified:
The Service ID (e.g., com.projectx.web.login) is created under Apple Developer → Identifiers → Service IDs
The redirect URI is correct and matches exactly (HTTPS, no trailing slash)
No client_secret is passed in the frontend (by design)
We’re using usePopup: true
❌ What Doesn’t Work:
Any new Service ID we create — even on the same domain and configuration — fails with invalid_client.
🔁 What We’ve Tried:
Creating multiple new Service IDs
Waiting 48+ hours in case of propagation delays
Validating HTTPS and redirect URI setup
Comparing all settings with the working (older) Service ID (which we deleted since we thought that was causing a problem)
Testing in different environments and browsers
❓ Questions:
Why do newly created Service IDs fail with invalid_client while older ones work?
Are there undocumented requirements, propagation delays, or steps for new Service IDs to become active?
Is this a known limitation or bug in the SDK?
💻 Our Code:
import { useEffect } from "react";
import { Button, Box } from "@mui/material";
import api from "../utils/api"; // Axios wrapper
import AppleIcon from "@mui/icons-material/Apple";
import MainAuthStyles from "../pages/MainAuthStyles";
import { useUser } from "../../../user-module/src/contexts/UserContext";
import { useNavigate } from "react-router-dom";
// Apple global type
declare global {
interface Window {
AppleID: any;
}
}
type AppleSignInButtonProps = {
setApiError: (msg: string) => void;
};
const AppleLogInButton = ({ setApiError }: AppleSignInButtonProps) => {
const { user, setUser } = useUser();
const navigate = useNavigate();
useEffect(() => {
if (!window.AppleID) return;
window.AppleID.auth.init({
clientId: import.meta.env.VITE_APPLE_CLIENT_ID,
scope: "name email",
redirectURI: import.meta.env.VITE_APPLE_REDIRECT_URI,
usePopup: true,
});
}, []);
const handleAppleLogin = async () => {
try {
const response = await window.AppleID.auth.signIn();
const { id_token, code, user } = response.authorization;
const res = await api.post("/auth/apple-login", {
idToken: id_token,
code,
user,
rememberMe: true,
});
if (res.data.success == true &&
res.data.user.userDataInitialised == true
) {
setUser({
id: res.data.user.id ? res.data.user.id : '',
fullName: res.data.user.fullName ? res.data.user.fullName : '',
email: res.data.user.email ? res.data.user.email : '',
role: res.data.user.role ? res.data.user.role : '',
signUpType: res.data.user.signUpType ? res.data.user.signUpType : '',
userDataInitialised: res.data.user.userDataInitialised ? res.data.user.userDataInitialised : false,
});
localStorage.setItem("accessToken", res.data.accessToken);
localStorage.setItem("refreshToken", res.data.refreshToken);
navigate("/app")
} else {
setApiError("Unrecognized login method")
return;
}
} catch (err) {
console.error("Apple Sign-In failed", err);
setApiError("AppleSignInFailed");
}
};
return (
<Box mt={2}>
<Button
variant="outlined"
fullWidth
onClick={handleAppleLogin}
className="AuthAppleButton"
startIcon={<AppleIcon />}
>
Log in with Apple
</Button>
</Box>
);
};
export default AppleLogInButton;
Any help from the Apple team or anyone who's resolved this issue would be appreciated — we’re currently blocked on deploying new environments due to this error.
Thanks!
Topic:
Community
SubTopic:
Apple Developers
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
Hi,
I have setup Apple SignIn on a platform i am developing and configure all the required Service IDs and redirect URLs.
The integration worked up until I moved the platform to a new domain name last friday. I have reconfigured the list of allowed domains and redirect urls to the new domain name, and removed all the mentions of the former one. Since then, when trying to Sign In with Apple, I am greated with the following error : " invalid_request - Invalid web redirect url".
I have also observed that if i manually change the domain name in the redirect_uri parameter but keep the rest of the OAuth URL identical, the error disappears. This should not be possible since the former domain name has been completely removed from the Service ID configuration.
Is there a propagation time for this ? And if so, it seems very long (5 days and pending).
I have checked and rechecked and tripled checked my configuration, every time by going in my dev account > Identifiers > Service IDs > Sign In with Apple > Configure, then clicking Done > Continue > Save.
I can confirm that :
the redirect domains and URLs there are correct, and no mention of the former domain name is present
I can still login using the former domain redirect urls (so my implementation is valid, but the configuration is not up to date)
the new redirect urls are still not working as of now
https is included in the redirect_urls, no trailing slash is present. again, the same URLs but with a different domain name were configured and worked (if anything, still work) properly
TLS 1.3 connection (i know 1.2 is a requirement)
Any advice would be welcome
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Sign in with Apple
Sign in with Apple JS
On Thursday, June 12, 2025, Sign in with Apple was impacted by an incorrect subdomain defined in its /.well-known/openid-configuration file. The JSON returned incorrectly provided https://account.apple.com instead of the expected https://appleid.apple.com.
For Sign in with Apple, the value for the issuer (iss) claim in the user's identity token is https://appleid.apple.com. Additionally, if your clients use the Sign in with Apple REST API, the following endpoints should be used for each request:
https://appleid.apple.com/auth/authorize
https://appleid.apple.com/auth/token
https://appleid.apple.com/auth/revoke
https://appleid.apple.com/auth/keys
This issue with the /.well-known/openid-configuration file was resolved the same day. Use the URL below to confirm the expected subdomain is provided, as needed:
https://appleid.apple.com/.well-known/openid-configuration
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
On Wednesday, June 18, 2025, Sign in with Apple was impacted by a configuration issue which affected some developer accounts that created new app or Services ID configurations, or edited existing configurations, resulting in the following errors:
invalid_client response error returned by the authentication, token validation/revocation, and user migration requests
"Sign Up Not Completed" (or equivalent) error presented from the Authentication Services framework.
On Monday, June 23, 2025, this issue was resolved. Please retry the Sign in with Apple flows in your Sign in with Apple enabled apps and websites to confirm your developer account configuration has been fixed.
Please let us know if you can still reproduce this issue with your developer account. If so, follow the steps outlined in the post below:
Gathering required information for troubleshooting Sign in with Apple authorization and token requests
https://developer.apple.com/forums/thread/762831
Finally, reply (not comment) with your Feedback ID on either of the posts below:
https://developer.apple.com/forums/thread/789011
https://developer.apple.com/forums/thread/789132
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS
Hi,
Before I begin my investigation, I want to explain our code-level support process for issues related to Sign in with Apple—as the issue you’re reporting may be the result of any of the following:
An error in your app or web service request.
A configuration issue in your Developer Account.
An internal issue in the operation system or Apple ID servers.
To ensure the issue is not caused by an error within your Private Email Replay configuration, please review Configuring your environment for Sign in with Apple to learn more about registering your email sources and authenticated domains.
To prevent sending sensitive message details in plain text, you should create a report in Feedback Assistant to share the details requested below. Additionally, if I determine the error is caused by an internal issue in the operating system or Apple ID servers, the appropriate engineering teams have access to the same information and can communicate with you directly for more information, if needed. Please follow the instructions below to submit your feedback.
Gathering required information for troubleshooting Private Email Relay with Sign in with Apple
For issues occurring with your email delivery, ensure your feedback contains the following information:
the primary App ID and Services ID
the user’s Apple ID and/or email address
the email message headers
the Private Email Relay Service or Hide My Email message delivery failure, and SMTP error codes
Submitting your feedback
Before you submit to Feedback Assistant, please confirm the requested information above is included in your feedback. Failure to provide the requested information will only delay my investigation into the reported issue within your Sign in with Apple client.
After your submission to Feedback Assistant is complete, please respond in your existing Developer Forums post with the Feedback ID. Once received, I can begin my investigation and determine if this issue is caused by an error within your client, a configuration issue within your developer account, or an underlying system bug.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Tags:
Sign in with Apple REST API
Sign in with Apple
Sign in with Apple JS