当用户使用apple id登录时,我正在获得授权。从授权。凭据,我可以得到身份令牌和授权码。但是无限制VPN sdk需要accessToken来注册新用户。您可以在下面看到我的代码。
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"
}
}
我做错了什么吗?有什么办法可以让我从苹果公司获得访问令牌吗?
社交登录没有完全实现。