Unable to login with apple account

Our application used web3auth before and it worked fine, but since last 2 weeks there has been an error when logging in with apple account.

Please provide the following details too when asking for help in this category:

  • SDK Version: 6.0.1

  • Screenshots of error:

  • Related to Custom Authentication? Please provide the following info too: (Optional)

    • Sample idToken(JWT): eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlRZT2dnXy01RU9FYmxhWS1WVlJZcVZhREFncHRuZktWNDUzNU1aUEMwdzAifQ.eyJpYXQiOjE2ODYyMTY0MDcsImF1ZCI6IkJBOWt3bTlTeGVvalFVN2lZNDdxYk04a2xoa3VPc21LVFg2NDFMU3B3SFJoU3RhWkt6cDBNWENXbmZ3eG1LX2I4QVVQNTJ2SFRJOFRfblNyclV4N1VfNCIsIm5vbmNlIjoiMDJmMmNmZDM4NTdlYjM4MDI3YjQ1M2Q3MjkwZWZhYzE1YjViZGU1YjkzNDM3ZjI0OWQ5YzM0MjllODliYTA3MzU4IiwiaXNzIjoiaHR0cHM6Ly9hcGkub3BlbmxvZ2luLmNvbSIsIndhbGxldHMiOlt7InB1YmxpY19rZXkiOiIwMjJiNDNjYjY5ZWY1YjZiYjkxZjg1YThkMWQ2OGE1MGU1OTg4NWQ3NGQ0M2IyOTM0ZjQ2OTE2ZDRhNmZhMTA2ODAiLCJ0eXBlIjoid2ViM2F1dGhfYXBwX2tleSIsImN1cnZlIjoic2VjcDI1NmsxIn1dLCJlbWFpbCI6ImR1Y25ndXllbjAxMDkuaXRAZ21haWwuY29tIiwibmFtZSI6IsSQ4bupYyBOZ3V5w6puIE5ndXnhu4VuIiwicHJvZmlsZUltYWdlIjoiaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUFjSFR0ZXFidGZpQkZ3S0w5WWtSTlVxRXlqNUJuRnhFUzllQ0xtSG9iZWM9czk2LWMiLCJ2ZXJpZmllciI6InRvcnVzIiwidmVyaWZpZXJJZCI6ImR1Y25ndXllbjAxMDkuaXRAZ21haWwuY29tIiwiYWdncmVnYXRlVmVyaWZpZXIiOiJ0a2V5LWdvb2dsZSIsImV4cCI6MTY4NjMwMjgwN30.2h_I6Dy2kdy5eudwi86yVIA7PVnsGtgnZ_uKImxDIXfd6q1KXV-5osb5bAataLoToF3o947-fMXXlejyL7P6og

Please provide the Web3Auth initialization and login code snippet below:

func connectWithWeb3Auth(presenter: UIViewController, provider: Web3AuthProvider, completion: @escaping LoginCompletion) {
        Task {
            do {
                let result = try await Web3Auth(
                    W3AInitParams(
                        clientId: AuthenticationManager.Constant.Web3AuthServiceId,
                        network: .mainnet,
                        whiteLabel: W3AWhiteLabelData(
                            name: "Web3Auth",
                            defaultLanguage: Locale.current.languageCode,
                            dark: false
                        )
                    ))
                .login(W3ALoginParams(loginProvider: provider))
                if let userInfo = result.userInfo, let idToken = userInfo.idToken {
                    UserManager.shared.privateKey = result.privKey
                    self.loginWithWeb3(idToken: idToken, completion)
                } else {
                    completion(.failure(SocialsAuth.defaultError))
                }
            } catch {
                completion(.failure(error))
            }
        }
    }

Someone please help me

@ducnguyen.nightmare Thanks for your patience.

Your reported issue has been shared with the team. I will then provide updates as soon as more information becomes available.

Thank you so much, my project was rejected by Apple Review many time cuz this problem

Hey @ducnguyen.nightmare

It looks like you’re passing the web3auth’s idToken back to us for login when the login has already happened.

Could you please elaborate on how you intend to use this?

Hi @shahbaz ,
self.loginWithWeb3(idToken: idToken, completion): this is just my self-defined function to get user information through idToken just logged in

Thanks for clarifying.

Only happening with Apple? or with other providers too?

Also, can you confirm, just before this, what’s the URL you see?

@shahbaz It only happens with apple login.
Before the error occurred, it just navigated to app.openlogin.com

Thank you for confirming. Would you mind testing this on the testnet and sharing your findings here? I’m also working on reproducing the issue in the meantime.



This is 2 screen shoots sent by apple review after they rejected my app again.

Hey @ducnguyen.nightmare

Is there a way we can test your app? Because from the screenshots looks like they might have pressed the back button or refreshed the page.

Hi @shahbaz @vjgee , After the previous response in July, it seems that your side has fixed this login error, but since the past 2 weeks, it has returned to this login error, our application has been rejected by Apple several times because this problem. Please help me check again.

This is my source code:

func connectWithWeb3Auth(presenter: UIViewController, provider: Web3AuthProvider, completion: @escaping LoginCompletion) {
        Web3Auth(
            W3AInitParams(
                clientId: AuthenticationManager.Constant.Web3AuthServiceId,
                network: .mainnet
            ))
        .login(W3ALoginParams(loginProvider: provider, mfaLevel: .NONE)) {
                switch $0 {
                case .success(let result):
                    if let userInfo = result.userInfo, let idToken = userInfo.idToken {
                        print("idToken: \(idToken)")
                    } else {
                        completion(.failure(SocialsAuth.defaultError))
                    }
                case .failure(_):
                    break
                }
            }
    }

Can someone help me?

Your issue has been reported to our team and is under review. You will receive further updates.

1 Like

Hey @ducnguyen.nightmare

Could you please share more information by clicking on the red exclamation mark you see on this window?

@ducnguyen.nightmare Can you please reply with the console logs so we can proceed?