Skip to content

Conversation

@kyuridenamida
Copy link
Owner

@kyuridenamida kyuridenamida commented Nov 9, 2025

Why is this change needed?

AtCoder introduced CAPTCHA to their login system, making it impossible to use traditional username/password automatic login. Users can no longer authenticate programmatically using credentials, causing all login attempts to fail.

(Japanese)
AtCoderにCAPTCHAが導入されたため、従来のユーザー名/パスワードによる自動ログインができなくなったから。

What did you implement?

  • Replaced default_credential_supplier() with default_cookie_supplier() that returns Cookie objects
  • Modified login() method to accept cookie_supplier parameter instead of credential_supplier
  • Added show_cookie_instructions() function that displays bilingual (English/Japanese) instructions for obtaining REVEL_SESSION cookie
  • Updated test files to use fake cookie suppliers instead of credential suppliers
  • Removed username/password login fallback mechanism
  • Updated README.md to document the new cookie-based authentication method

(Japanese)
REVEL_SESSIONクッキーベースの認証システムに置き換えた。ユーザー名/パスワード入力の代わりにブラウザからコピーしたクッキー値を使用してログインする仕組みを実装。

What behavior do you expect?

When you run any atcoder-tools command that requires login (e.g., atcoder-tools gen abc001) for the first time:

  1. The system displays bilingual instructions for obtaining REVEL_SESSION cookie
  2. User is prompted to input the cookie value: REVEL_SESSION cookie value:
  3. After entering valid cookie, login succeeds and cookie is cached locally
  4. Subsequent commands use the cached cookie for automatic authentication
  5. If cached cookie expires, user is prompted to enter a new cookie value

The console output should show:

  [English]
  === How to get AtCoder REVEL_SESSION cookie ===
  1. Log in to AtCoder using your browser
     https://atcoder.jp/login
  ...
  [日本語/Japanese]
  === AtCoder REVEL_SESSION クッキーの取得方法 ===
  ...
  REVEL_SESSION cookie value: [user inputs cookie here]

(Japanese)
初回実行時にREVEL_SESSIONクッキーの取得手順が英語・日本語で表示され、ユーザーがクッキー値を入力すると認証が成功し、以降は自動ログインされる。

@kyuridenamida kyuridenamida merged commit 91ee8f1 into stable Nov 14, 2025
3 checks passed
@kyuridenamida kyuridenamida deleted the fix-broken-login branch November 14, 2025 16:27
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.

2 participants