diff options
author | Vitaly Takmazov | 2018-11-23 10:24:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-23 10:28:39 +0300 |
commit | 84db638ba1fff04887b5d6f16a33621f760a0cc7 (patch) | |
tree | 5944e587e209ee15ef4e81e7fa0a64b5f9c1bdd5 /src | |
parent | 63c62a603b8d901059dbb402c2ca13ced68f3fb5 (diff) |
Fix google client initialisation
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/server/api/ApiSocialLogin.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/juick/server/api/ApiSocialLogin.java b/src/main/java/com/juick/server/api/ApiSocialLogin.java index 54a5d1bb..d6a103b4 100644 --- a/src/main/java/com/juick/server/api/ApiSocialLogin.java +++ b/src/main/java/com/juick/server/api/ApiSocialLogin.java @@ -54,6 +54,7 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; import java.io.IOException; import java.security.GeneralSecurityException; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.UUID; @@ -89,8 +90,8 @@ public class ApiSocialLogin { private String VK_SECRET; @Value("${telegram_token:secret}") private String telegramToken; - @Value("${google_client_ids:ids") - private List<String> googleClientIds; + @Value("${google_client_id:}") + private String googleClientId; @Inject private CrosspostService crosspostService; @@ -111,7 +112,7 @@ public class ApiSocialLogin { twitterBuilder = new ServiceBuilder(twitterConsumerKey); vkBuilder = new ServiceBuilder(VK_APPID); verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory) - .setAudience(googleClientIds) + .setAudience(Collections.singletonList(googleClientId)) .build(); } @@ -293,7 +294,7 @@ public class ApiSocialLogin { public IdToken.Payload googleSignIn(@RequestParam(name = "idToken") String idTokenString) throws GeneralSecurityException, IOException { logger.info("Token: {}", idTokenString); - logger.info("Clients: {}", googleClientIds); + logger.info("Client: {}", googleClientId); GoogleIdToken idToken = verifier.verify(idTokenString); if (idToken != null) { return idToken.getPayload(); |