mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 04:01:51 +09:00
docs: README.md에 인증서 설정 방법 추가
refactor: GoogleLoginHint.py에서 불필요한 import 제거 및 URL 수정 로직 개선
This commit is contained in:
parent
c511b3bfd7
commit
897173ba46
2 changed files with 19 additions and 6 deletions
17
README.md
17
README.md
|
|
@ -20,6 +20,23 @@ venv와 패키지가 설치가 됩니다.
|
|||
|
||||
입력하지 않는다면 Google OAuth시 자동적으로 넘어가지 않을 수도 있습니다.
|
||||
|
||||
---
|
||||
|
||||
> [oauth-backend](https://github.com/j93es/oauth-backend) 프록시를 사용한다면 이 가이드에 따라 인증서 또한 설정되어야만 합니다.
|
||||
>
|
||||
> 그렇지 않으면 실행되지 않습니다.
|
||||
>
|
||||
> 윈도우 환경에서는 `sudo certutil -addstore root mitmproxy-ca-cert.cer`로 인증합니다.
|
||||
>
|
||||
> Sudo가 활성화되어있지 않은 환경에서는 관리자로 상향된 쉘에서 실행합니다.
|
||||
>
|
||||
> MacOS 환경에서는 `sudo security add-trusted-cert -d -p ssl -p basic -k /Library/Keychains/System.keychain ~/.mitmproxy/mitmproxy-ca-cert.pem`으로 인증합니다.
|
||||
>
|
||||
> 다른 플렛폼은 수동으로 설정되어야만 합니다.
|
||||
> https://docs.mitmproxy.org/stable/concepts/certificates/
|
||||
|
||||
---
|
||||
|
||||
# 실행 방법
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import lib.target as target
|
||||
from lib.report import save_report
|
||||
import os
|
||||
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
||||
from dotenv import load_dotenv
|
||||
|
|
@ -16,7 +14,6 @@ class GoogleLoginHint:
|
|||
async def request(self, flow):
|
||||
"""Google OAuth 요청을 가로채서 login_hint를 추가하거나 수정"""
|
||||
req = flow.request
|
||||
method = req.method
|
||||
url = req.pretty_url
|
||||
|
||||
# Google OAuth 인증 URL인지 확인
|
||||
|
|
@ -45,11 +42,10 @@ class GoogleLoginHint:
|
|||
parsed_url.fragment
|
||||
))
|
||||
|
||||
# 요청 URL 수정
|
||||
# 요청 URL 수정 - URL과 호스트 모두 업데이트
|
||||
flow.request.url = new_url
|
||||
flow.request.pretty_url = new_url
|
||||
print(f"🔄 Modified URL: {new_url}")
|
||||
|
||||
|
||||
def _is_google_oauth_url(self, url):
|
||||
"""Google OAuth URL인지 확인"""
|
||||
google_oauth_domains = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue