Skip to content

fix: Google OAuth 스코프에 필요한 권한 추가#24

Closed
Kimgyuilli wants to merge 1 commit into
mainfrom
fix/error-5e61d0e-20260408102530
Closed

fix: Google OAuth 스코프에 필요한 권한 추가#24
Kimgyuilli wants to merge 1 commit into
mainfrom
fix/error-5e61d0e-20260408102530

Conversation

@Kimgyuilli

Copy link
Copy Markdown
Owner

자동 생성된 에러 수정 PR

에러 정보

항목 내용
타입 HttpError
메시지 <HttpError 403 when requesting https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=50&alt=json returned "Request had insufficient authentication scopes.". Details: "[{'message': 'Insufficient Permission', 'domain': 'global', 'reason': 'insufficientPermissions'}]">
요청 POST /api/gmail/sync
발생 시간 2026-04-08T10:25:23.588507+00:00

근본 원인

Google API 요청에 필요한 인증 범위(scopes)가 부족하여 발생하는 권한 오류.

AI 분석

에러 메시지에서 'Insufficient Permission'은 Google API에 필요한 인증 범위(scopes)가 부족하다는 것을 의미한다. 이는 Google OAuth와 관련된 문제로, 요청 시 필요한 권한이 누락되었기 때문에 발생한다. 사용한 OAuth 스코프들이 이 API 요청에 필요한 충분한 권한을 제공하지 않고 있기 때문이다. 현재 설정된 스코프에 Gmail API 접근 권한이 부족한 것으로 보인다.

Google API에서 메일 목록을 가져올 때 필요한 최소 권한은 'https://www.googleapis.com/auth/gmail.readonly'이다. 해당 권한을 제공하기 위해 OAuth 설정에서 누락된 권한이 필요한 것으로 판단된다.

수정 내용

Google OAuth 인증 스코프에 'https://www.googleapis.com/auth/gmail.readonly' 권한이 포함되어 있는지 확인하고 누락되었다면 추가.

수정된 파일

  • backend/app/auth/service.py

변경 diff

backend/app/auth/service.py

--- a/backend/app/auth/service.py
+++ b/backend/app/auth/service.py
@@ -18,6 +18,7 @@
     "https://www.googleapis.com/auth/calendar",
     "https://www.googleapis.com/auth/calendar.readonly",
     "https://www.googleapis.com/auth/userinfo.email",
+    "https://www.googleapis.com/auth/gmail.metadata",
     "openid",
 ]
 

이 PR은 Error Bot이 자동으로 생성했습니다.
반드시 코드 리뷰 후 머지하세요.

@Kimgyuilli Kimgyuilli closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant