Google Verify the integrity of the ID token gettirn the ERROR : IllegalArgumentException

Google Verify the integrity of the ID token gettirn the ERROR : IllegalArgumentException

我正在尝试使用 Spring 引导验证 google 令牌 ID。 我按部就班this link

GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory) // Specify the CLIENT_ID of the app that accesses the backend: .setAudience(Collections.singletonList(CLIENT_ID)) // Or, if multiple clients access the backend: //.setAudience(Arrays.asList(CLIENT_ID_1, CLIENT_ID_2, CLIENT_ID_3)) .build();

我在 valur CLIENT_ID 中使用我的 客户端 ID google app 但是当我添加

GoogleIdToken idToken = verifier.verify("someText");

我收到以下错误

Caused by: java.lang.IllegalArgumentException: null
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) ~[google-http-client-1.24.1.jar:1.24.1]
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:37) ~[google-http-client-1.24.1.jar:1.24.1]
at com.google.api.client.json.webtoken.JsonWebSignature$Parser.parse(JsonWebSignature.java:602) ~[google-http-client-1.24.1.jar:1.24.1]
at com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.parse(GoogleIdToken.java:57) ~[google-api-client-1.24.1.jar:1.24.1]
at com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier.verify(GoogleIdTokenVerifier.java:191) ~[google-api-client-1.24.1.jar:1.24.1]
at org.sid.InwiBoApplication.run(InwiBoApplication.java:59) [classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:818) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
... 10 common frames omitted

我不必在 GoogleIdToken idToken = verifier.verify("someText");

中使用 "someText"

我必须使用 String,其中 format 类似于 IdToken format