コード例 #1
0
        public IActionResult Authenticate([FromBody] AuthenticateRequest data)
        {
            GoogleJsonWebSignature.ValidationSettings settings = new GoogleJsonWebSignature.ValidationSettings();

            // Change this to your google client ID
            settings.Audience = new List <string>()
            {
                "425874635785-9qbseena0h69r9f6jbe7o84qpfjk6krr.apps.googleusercontent.com"
            };

            GoogleJsonWebSignature.Payload payload = GoogleJsonWebSignature.ValidateAsync(data.IdToken, settings).Result;
            return(Ok(new { AuthToken = _jwtGenerator.CreateUserAuthToken(payload.Email) }));
        }