From 77283a0b7ffcb1a67e09aa79500b2cd2898dd36b Mon Sep 17 00:00:00 2001 From: tiejinjiang-git Date: Wed, 4 Jan 2023 02:50:41 +0000 Subject: [PATCH] update Account-Server-Java-Demo/src/main/java/com/huawei/apidemo/TokenAPIDemo.java. Added the description about whether the code is encoded. Signed-off-by: tiejinjiang-git --- .../src/main/java/com/huawei/apidemo/TokenAPIDemo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Account-Server-Java-Demo/src/main/java/com/huawei/apidemo/TokenAPIDemo.java b/Account-Server-Java-Demo/src/main/java/com/huawei/apidemo/TokenAPIDemo.java index 93d7043..8358383 100644 --- a/Account-Server-Java-Demo/src/main/java/com/huawei/apidemo/TokenAPIDemo.java +++ b/Account-Server-Java-Demo/src/main/java/com/huawei/apidemo/TokenAPIDemo.java @@ -62,6 +62,7 @@ public class TokenAPIDemo { //By requesting the following URL to get code returned by the user to confirm the authorization // (url:https://oauth-login.cloud.huawei.com/oauth2/v3/authorize?response_type=code&access_type=offline&state=state_parameter_passthrough_value&client_id=101484061&redirect_uri=hms://redirect_url&scope=openid+profile) String code = "CV4e3VYs22cDEVydKG7KlKbz4UrU1G78V9f7i4wqMzjzQ4lcYa90XRw37fWrYoPz8L%2B%2BqH8QHZW82bsPQ3eSPrdpF585YrXsNR%2BcuEKGKKlalq6ref5%2FX7V2%2BZzwIF0yUrRwmxqHoM4kpj4kcGZ0rTrpOy7xG4%2B41rpEdF7tZPod0WeDkSTv0gDWWq%2B64%2BAFyxDv17gDsm0%3D"; + // If the code is encoded by urlEncode once (eg. the value of the the preceding code ), please run the following to urlDecode once. code = java.net.URLDecoder.decode(code, "utf-8"); JSONObject tokens = getTokenByCode(redirect_uri, urlToken, code, client_secret, client_id, grant_type); -- Gitee