diff options
Diffstat (limited to 'src/main/java/com/github/scribejava')
-rw-r--r-- | src/main/java/com/github/scribejava/apis/AppleSignInApi.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/github/scribejava/apis/AppleSignInApi.java b/src/main/java/com/github/scribejava/apis/AppleSignInApi.java index 7d960d35..7b0fae81 100644 --- a/src/main/java/com/github/scribejava/apis/AppleSignInApi.java +++ b/src/main/java/com/github/scribejava/apis/AppleSignInApi.java @@ -30,11 +30,11 @@ import com.nimbusds.jose.proc.SecurityContext; import com.nimbusds.jwt.proc.ConfigurableJWTProcessor; import com.nimbusds.jwt.proc.DefaultJWTClaimsVerifier; import com.nimbusds.jwt.proc.DefaultJWTProcessor; -import net.minidev.json.JSONObject; import java.net.MalformedURLException; import java.net.URL; import java.text.ParseException; +import java.util.Map; import java.util.Optional; public class AppleSignInApi extends DefaultApi20 { @@ -92,15 +92,15 @@ public class AppleSignInApi extends DefaultApi20 { jwtProcessor.setJWTClaimsSetVerifier(new DefaultJWTClaimsVerifier<>()); // Process the token - JSONObject claimsSet = null; + Map<String, Object> claimsSet; try { claimsSet = jwtProcessor.process(idToken, null).toJSONObject(); } catch (ParseException | BadJOSEException | JOSEException e) { return Optional.empty(); } - var email = claimsSet.getAsString("email"); - var verified = claimsSet.getAsString("email_verified").equals("true"); + String email = (String)claimsSet.get("email"); + boolean verified = claimsSet.get("email_verified").equals("true"); return verified ? Optional.of(email) : Optional.empty(); } } |