From 60a68087f70b39836267f5f6e13385f1329974e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=BF=90=E5=AE=B6?= Date: Thu, 27 Jun 2024 10:38:41 +0800 Subject: [PATCH] =?UTF-8?q?google=E8=B4=A6=E5=8F=B7=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0game=20account=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=EF=BC=8C=E4=BE=BF=E4=BA=8E=E5=90=8E=E6=9C=9F?= =?UTF-8?q?=E6=8B=93=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/src/social/google.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/src/social/google.rs b/library/src/social/google.rs index eb80048..695a63e 100644 --- a/library/src/social/google.rs +++ b/library/src/social/google.rs @@ -169,7 +169,11 @@ impl GoogleSocial { .get(&kid) .ok_or_else(|| Box::new(ResErr::social("校验Token失败,未找到正确的公钥")))?; - tracing::info!("public key : {:?}", key); + tracing::debug!("public key : {:?}", key); + // TODO: + // 如果是google game account,可能找不到正确的公钥,需要使用oauth2开发库来实现相应的校验 + // oauth2开发库参考https://github.com/ramosbugs/oauth2-rs/blob/main/examples/google.rs + // google game account账户校验参考:https://github.com/heroiclabs/nakama/blob/master/social/social.go // 验证Token let mut validation: Validation = Validation::new(Algorithm::RS256);