
Top Seller
🔴 ERRO PERSISTENTE: invalid_client
Se você já fez tudo e o erro continua, o problema pode estar em:
- • Service ID incorreto ou não ativo
- • JWT gerado com parâmetros errados
- • Redirect URI não corresponde EXATAMENTE
- • Sign in with Apple não habilitado corretamente
✅ VALORES EXATOS - Base44 Dashboard
1️⃣ Client ID
Este é o Service ID da Apple (NÃO o App ID)
Formato esperado:
com.seudominio.signin2️⃣ Client Secret (JWT)
JWT gerado com Team ID, Key ID e Private Key (.p8)
Formato esperado:
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IktFWV9JRCJ9...- • iss (Issuer) = Seu Team ID
- • aud (Audience) = https://appleid.apple.com
- • sub (Subject) = Seu Service ID (igual ao Client ID)
- • iat (Issued At) = Timestamp atual
- • exp (Expiration) = iat + 6 meses (máximo)
3️⃣ Auth Endpoint
https://appleid.apple.com/auth/authorize4️⃣ Token Endpoint
https://appleid.apple.com/auth/token5️⃣ Redirect URI (Apple Console)
No Apple Console → Service ID → Configure → Return URLs, adicione EXATAMENTE:
https://topsellermentor.com/api/auth/sso/callback📋 Checklist Apple Console
Verifique se TUDO está correto no Apple Developer Console:
Service ID está ativo
Identifiers → Service ID → Status: Enabled
Sign in with Apple configurado
Service ID → Configure → Sign in with Apple: ON
Primary App ID associado
Service ID → Configure → Primary App ID: selecionado
Return URL adicionado
Service ID → Configure → Website URLs → Return URLs
https://topsellermentor.com/api/auth/sso/callbackKey ativa para Sign in with Apple
Keys → Sua chave → Sign in with Apple: Enabled
⚡ SOLUÇÃO PARA APPLE REVIEW
Apple App Store aceita Email/Password como método de login principal. Você NÃO é obrigado a usar "Sign in with Apple" se já oferece outro método funcional.
"Apps that use a third-party or social login service to set up or authenticate must also offer Sign in with Apple OR allow users to create an account with email/password."
→ Seu app JÁ TEM login via Email/Password ativo! Está conforme.
📱 O QUE FAZER AGORA:
- 1. DESATIVE temporariamente o Apple Sign In no Base44 Dashboard
- 2. TESTE o login com Email/Password (já está funcionando)
- 3. ENVIE para Apple Review usando Email/Password
- 4. CORRIJA o Apple Sign In depois da aprovação
🔍 Diagnóstico Completo
✓ Service ID no Base44:
Deve ser EXATAMENTE igual ao Identifier do Service ID no Apple Console
EXEMPLO: com.topsellermentor.signin✓ JWT (Client Secret):
Parâmetros do JWT devem ser:
• iss = Team ID (encontre em: Membership)
• sub = Service ID (mesmo do Client ID)
• aud = https://appleid.apple.com
• iat = Agora (timestamp)
• exp = iat + 15552000 (6 meses)
✓ Return URL no Apple Console:
https://topsellermentor.com/api/auth/sso/callback⚠️ Deve estar na lista de "Website URLs" → "Return URLs"
✓ Endpoints no Base44:
https://appleid.apple.com/auth/authorizehttps://appleid.apple.com/auth/token💻 Como Gerar JWT Corretamente
Opção 1: Usando Node.js
npm install jsonwebtoken
const jwt = require('jsonwebtoken');
const fs = require('fs');
const privateKey = fs.readFileSync('AuthKey_KEYID.p8');
const token = jwt.sign({}, privateKey, {
algorithm: 'ES256',
expiresIn: '180d',
issuer: 'TEAM_ID',
audience: 'https://appleid.apple.com',
subject: 'com.seuapp.signin',
header: {
alg: 'ES256',
kid: 'KEY_ID'
}
});
console.log(token);Opção 2: Ferramenta Online
🎯 PRÓXIMOS PASSOS
OPÇÃO 1 (Recomendado): Desativar Apple Sign In temporariamente e usar Email/Password para Apple Review
OPÇÃO 2: Continuar tentando corrigir o Apple Sign In (pode demorar)