简体   繁体   中英

Register Social on Unlimited VPN SDK using Apple Sign in not working

When user signs in using apple id I am getting authorization. From authorization.credential I can get Identity token and authorizationCode. But the Unlimited VPN sdk needs accessToken to register a new user. You can see my code below.

private func registerUsingAppleID(appleIDCredential: ASAuthorizationAppleIDCredential) {
        guard let identityTokenData = appleIDCredential.identityToken, let identityTokenString = String(data: identityTokenData, encoding: .utf8) else {
            return
        }
        KSVPNUFacade.default.registerSocial(withLogin: appleIDCredential.email,
                                            serviceType: VPNUSocialServiceTypeApple,
                                            accessToken: identityTokenString,
                                            refreshToken: nil, // For only google
                                            idToken: nil, // For only google
                                            marketingEmails: true,
                                            partnerId: ThirdVpnConfig.getUnlimitedVPNPartnerID()) {
            longAccessToken, data, error in
            // returns error "Request failed. bad gateway"
        }
    }

Am I doing anything wrong? Is there any way that I can get access token from apple.

Social login was not fully implemented from keepsolid's side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM