From 613d1f98624a762cab61d807061705ed17f41b7f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 10 Sep 2020 21:15:15 +0300 Subject: Update deps * Fix breaking changes compatibility with nimbus-jose-jwt 9.0 and postcss-loader 4.0 --- src/main/java/com/github/scribejava/apis/AppleSignInApi.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/github') 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 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(); } } -- cgit v1.2.3