@@ -864,7 +864,7 @@ async fn main() -> anyhow::Result<()> {
864864 - Set GOOGLE_API_KEY for Google Gemini\n \
865865 - Set GROQ_API_KEY for Groq (fast, free tier available)\n \
866866 - Run `coven-code --provider ollama` for local models (no key needed)\n \
867- - Anthropic OAuth login is disabled until Coven Code has its own OAuth client "
867+ - Configure COVEN_CODE_ANTHROPIC_OAUTH_CLIENT_ID, then run `coven-code auth login` for first-party Anthropic OAuth"
868868 ) ;
869869 } else {
870870 ( String :: new ( ) , false )
@@ -3840,13 +3840,11 @@ async fn run_interactive(
38403840 }
38413841 "anthropic" => {
38423842 let tx2 = device_auth_tx. clone ( ) ;
3843- // Anthropic OAuth requires a registered application.
3844- // Coven Code does not have its own registered OAuth app with Anthropic.
3845- // Users should use an API key from console.anthropic.com instead.
3843+ // Anthropic OAuth requires a registered Coven Code application.
38463844 tokio:: spawn ( async move {
38473845 let _ = tx2. send ( DeviceAuthEvent :: Error (
3848- "Anthropic OAuth requires a registered application .\n \
3849- Use an API key instead : console.anthropic.com/settings/keys". to_string ( )
3846+ "Anthropic OAuth requires COVEN_CODE_ANTHROPIC_OAUTH_CLIENT_ID .\n \
3847+ Configure a Coven Code OAuth client, or use an API key for now : console.anthropic.com/settings/keys". to_string ( )
38503848 ) ) . await ;
38513849 } ) ;
38523850 }
@@ -4238,7 +4236,7 @@ async fn run_interactive(
42384236// Called before Cli::parse() so it doesn't conflict with positional `prompt`.
42394237//
42404238// Usage:
4241- // claude auth login [--console] — Anthropic OAuth is disabled until Coven Code has its own client
4239+ // claude auth login [--console] — Anthropic OAuth with a configured Coven Code client
42424240// claude auth logout — Clear stored credentials
42434241// claude auth status [--json] — Show authentication status
42444242
@@ -4325,7 +4323,7 @@ async fn handle_auth_command(args: &[String]) -> anyhow::Result<()> {
43254323
43264324fn print_auth_usage ( ) {
43274325 eprintln ! ( "Usage: coven-code auth <subcommand>" ) ;
4328- eprintln ! ( " login [--console] [--label <name>] Authenticate (claude.ai by default) " ) ;
4326+ eprintln ! ( " login [--console] [--label <name>] Authenticate with a configured Coven Code OAuth client " ) ;
43294327 eprintln ! ( " logout Remove the active account's credentials" ) ;
43304328 eprintln ! ( " status [--json] Show authentication status" ) ;
43314329 eprintln ! ( " list List all stored Anthropic accounts" ) ;
@@ -4651,12 +4649,12 @@ async fn auth_status(json_output: bool) {
46514649 . filter ( |tokens| !tokens. uses_bearer_auth ( ) && tokens. api_key . is_some ( ) )
46524650 . map ( |_| "/login managed key" . to_string ( ) )
46534651 } ) ;
4654- let usable_oauth_tokens = oauth_tokens
4655- . as_ref ( )
4656- . filter ( |tokens| !tokens . uses_bearer_auth ( ) ) ;
4652+ let usable_oauth_tokens = oauth_tokens. as_ref ( ) . filter ( |tokens| {
4653+ !tokens . uses_bearer_auth ( ) || tokens . uses_configured_oauth_client ( )
4654+ } ) ;
46574655 let disabled_bearer_token = oauth_tokens
46584656 . as_ref ( )
4659- . is_some_and ( |tokens| tokens. uses_bearer_auth ( ) ) ;
4657+ . is_some_and ( |tokens| tokens. uses_bearer_auth ( ) && !tokens . uses_configured_oauth_client ( ) ) ;
46604658 let token_source = usable_oauth_tokens. map ( |tokens| {
46614659 if tokens. uses_bearer_auth ( ) {
46624660 "claude.ai" . to_string ( )
@@ -4739,9 +4737,9 @@ async fn auth_status(json_output: bool) {
47394737 if !logged_in {
47404738 let hint = if active_provider == "anthropic" {
47414739 if disabled_bearer_token {
4742- "Stored claude.ai OAuth tokens are disabled; set ANTHROPIC_API_KEY." . to_string ( )
4740+ "Stored claude.ai OAuth tokens were minted by an unsupported client; configure COVEN_CODE_ANTHROPIC_OAUTH_CLIENT_ID and run `coven-code auth login`, or set ANTHROPIC_API_KEY for now ." . to_string ( )
47434741 } else {
4744- "Set ANTHROPIC_API_KEY." . to_string ( )
4742+ "Set ANTHROPIC_API_KEY, or configure COVEN_CODE_ANTHROPIC_OAUTH_CLIENT_ID and run `coven-code auth login` ." . to_string ( )
47454743 }
47464744 } else if let Some ( env_var) =
47474745 claurst_core:: config:: primary_api_key_env_var_for_provider ( active_provider)
0 commit comments