Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google login 에서 유효하지 않은 값의 처리 #359

Closed
jpham005 opened this issue Oct 16, 2023 · 2 comments · Fixed by #373
Closed

google login 에서 유효하지 않은 값의 처리 #359

jpham005 opened this issue Oct 16, 2023 · 2 comments · Fixed by #373
Assignees
Labels
bug Something isn't working

Comments

@jpham005
Copy link
Member

No description provided.

@jpham005 jpham005 added this to 42Stat Oct 16, 2023
@jpham005 jpham005 converted this from a draft issue Oct 16, 2023
@jpham005 jpham005 added the bug Something isn't working label Oct 16, 2023
@yoopark yoopark moved this from 📋 Backlog to 🔖 Ready in 42Stat Oct 16, 2023
@jpham005
Copy link
Member Author

[Nest] 6057  - 10/06/2023, 12:25:38 PM   ERROR [ExceptionsHandler] Token used too late, 1696595138.018 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
Error: Token used too late, 1696595138.018 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:667:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:23)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/09/2023, 6:30:50 AM   ERROR [ExceptionsHandler] Token used too late, 1696833050.633 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
Error: Token used too late, 1696833050.633 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:667:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:23)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/09/2023, 7:44:36 AM   ERROR [ExceptionsHandler] Token used too late, 1696837476.411 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
Error: Token used too late, 1696837476.411 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:667:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:23)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/11/2023, 6:55:59 AM   ERROR [ExceptionsHandler] Token used too late, 1697007359.647 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
Error: Token used too late, 1697007359.647 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:667:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:23)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/11/2023, 1:17:23 PM   ERROR [ExceptionsHandler] Token used too late, 1697030243.04 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
Error: Token used too late, 1697030243.04 > 1696575326: {"iss":"https://accounts.google.com","nbf":1696571126,"aud":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","sub":"109519171035808387166","email":"wogml414@gmail.com","email_verified":true,"azp":"1094433376140-sjfhlq1q7luh0fkjnqcu9bvilmb4rro6.apps.googleusercontent.com","name":"Jaehee Jung","picture":"https://lh3.googleusercontent.com/a/ACg8ocKY-kCz4AxkAJlC4anexj0UYsEG_KgXZq0Ay9rRuAJ4=s96-c","given_name":"Jaehee","family_name":"Jung","iat":1696571426,"exp":1696575026,"jti":"ed6c1875b63680036f03e1221110ef125b967eab"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:667:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:23)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/12/2023, 8:27:44 AM   ERROR [ExceptionsHandler] No pem found for envelope: {"alg":"RS256","kid":"b9ac601d131fd4ffd556ff032aab188880cde3b9","typ":"JWT"}
Error: No pem found for envelope: {"alg":"RS256","kid":"b9ac601d131fd4ffd556ff032aab188880cde3b9","typ":"JWT"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:630:19)
    at OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:34)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
[Nest] 6057  - 10/13/2023, 7:33:09 AM   ERROR [ExceptionsHandler] No pem found for envelope: {"alg":"RS256","kid":"b9ac601d131fd4ffd556ff032aab188880cde3b9","typ":"JWT"}
Error: No pem found for envelope: {"alg":"RS256","kid":"b9ac601d131fd4ffd556ff032aab188880cde3b9","typ":"JWT"}
    at OAuth2Client.verifySignedJwtWithCertsAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:630:19)
    at OAuth2Client.verifyIdTokenAsync (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/google-auth-library@8.9.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:458:34)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async LoginService.getGoogleUser (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:112:24)
    at async LoginService.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.service.js:47:28)
    at async LoginResolver.googleLogin (/home/ubuntu/42Stat-Backend/app/dist/login/login.resolver.js:32:16)
    at async target (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)
    at async Object.googleLogin (/home/ubuntu/42Stat-Backend/app/node_modules/.pnpm/@nestjs+core@10.0.0_@nestjs+common@10.0.0_@nestjs+platform-express@10.0.0_reflect-metadata@0.1.13_rxjs@7.8.1/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)

@jpham005 jpham005 self-assigned this Oct 18, 2023
@jpham005 jpham005 moved this from 🔖 Ready to 🏗 In progress in 42Stat Oct 24, 2023
@jpham005
Copy link
Member Author

google 문서에서 verifyIdToken 이 실패하는 경우에 어떤 exception 이 발생되는지에 대한 설명이 없고,
링크 에서 코드를 확인해볼 수 있긴 하지만, 일단 try catch 로 exceptions layer 에 BadRequest 로 처리하기로 했습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant