mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 05:01:51 +09:00
feat: OAuth 제공자 추출 및 로그인 테스트 개선
This commit is contained in:
parent
20601cec76
commit
353e98e28c
4 changed files with 27 additions and 24 deletions
|
|
@ -116,7 +116,8 @@ async def extract_oauth_list(url: str):
|
|||
|
||||
try:
|
||||
data = json.loads(final_result)
|
||||
oauth_providers = data.get("oauth_providers", [])
|
||||
print(final_result)
|
||||
oauth_providers = data.get("sso_list", [])
|
||||
if not oauth_providers:
|
||||
print("❌ OAuth 제공자가 없습니다.")
|
||||
logger(f"❌ {url} - OAuth 제공자 없음: {final_result}")
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
|||
print(f"🔗 스캔 URL: {url}")
|
||||
print(f"🔐 발견된 OAuth 제공자들: {len(oauth_entries)}개")
|
||||
for entry in oauth_entries:
|
||||
print(f" - {entry.provider}")
|
||||
print(f" - {entry}")
|
||||
print("-" * 50)
|
||||
|
||||
# CSV에 OAuth 리스트 저장
|
||||
|
|
@ -41,12 +41,12 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
|||
if not file_exists:
|
||||
writer.writerow(["issuer", "provider", "oauth_uri", "login_tested"])
|
||||
for entry in oauth_entries:
|
||||
writer.writerow([url, entry.provider, "", "pending"])
|
||||
writer.writerow([url, entry, "", "pending"])
|
||||
|
||||
# 2단계: 각 OAuth 제공자별로 개별 로그인 시도
|
||||
for i, oauth_entry in enumerate(oauth_entries):
|
||||
print(
|
||||
f"\n🔄 OAuth 로그인 테스트 {i+1}/{len(oauth_entries)}: {oauth_entry.provider}"
|
||||
f"\n🔄 OAuth 로그인 테스트 {i+1}/{len(oauth_entries)}: {oauth_entry}"
|
||||
)
|
||||
|
||||
# OAuth 간 대기 시간
|
||||
|
|
@ -55,11 +55,11 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
|||
await asyncio.sleep(30)
|
||||
|
||||
# 개별 OAuth 로그인 시도
|
||||
success = await test_oauth_login(url, oauth_entry.provider)
|
||||
success = await test_oauth_login(url, oauth_entry)
|
||||
|
||||
# 결과를 CSV에 업데이트 (간단하게 로그만 남김)
|
||||
status = "success" if success else "failed"
|
||||
print(f"📝 {oauth_entry.provider} 로그인 결과: {status}")
|
||||
print(f"📝 {oauth_entry} 로그인 결과: {status}")
|
||||
|
||||
|
||||
async def main_loop(
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Your task is to navigate to the login page of the given URL. Follow the steps be
|
|||
- Username/password fields
|
||||
- Email-based login
|
||||
- Non-OAuth methods such as certificate or phone verification
|
||||
- ✅ If you are unsure whether a button is OAuth-based or not, you MUST click the button and check the redirect behavior yourself.
|
||||
|
||||
3. RETURN FORMAT
|
||||
- If the login page is successfully found, return:
|
||||
|
|
@ -58,4 +59,5 @@ Your task is to navigate to the login page of the given URL. Follow the steps be
|
|||
}
|
||||
```
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue