Apple 抱怨我的应用程序,因为我没有调用其余端点撤销令牌来删除帐户。我必须按照本文档中的描述进行操作:https ://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens
要调用,我需要获取client_id、client_secret和token。我的应用程序中的登录过程由 Firebase 管理,当用户执行登录时我不会保存此信息。因此,我需要从 IOS 上的 Firebase 身份验证恢复这 3 个参数,以调用该撤销令牌端点。
IOS 上的 Firebase auth API 中可能有一个方法可以为我调用 Apple 端点 revoke_token,但我没有看到它。
ios firebase swift firebase-authentication sign-in-with-apple
我试图实现的目标:
到目前为止我所拥有的:
拨打苹果验证电话:
restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
map.add("client_id", clientId); // app_id like com.app.id
String token = generateJWT(); // generated jwt
map.add("client_secret", token);
map.add("grant_type", "authorization_code");
map.add("code", authorizationCode); // JWT code we got from iOS
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);
final String appleAuthURL = "https://appleid.apple.com/auth/token";
String response = restTemplate.postForObject(appleAuthURL, request, String.class);
Run Code Online (Sandbox Code Playgroud)
代币生成:
final PrivateKey privateKey = getPrivateKey();
final int …Run Code Online (Sandbox Code Playgroud)