Skip to content

TW-4924: credential-based auth flow for IMAP, iCloud, Yahoo, and EWS providers#77

Merged
qasim-nylas merged 1 commit into
mainfrom
feature/TW-4924-credential-based-auth
May 12, 2026
Merged

TW-4924: credential-based auth flow for IMAP, iCloud, Yahoo, and EWS providers#77
qasim-nylas merged 1 commit into
mainfrom
feature/TW-4924-credential-based-auth

Conversation

@qasim-nylas
Copy link
Copy Markdown
Collaborator

@qasim-nylas qasim-nylas commented May 12, 2026

Summary

  • Extends nylas auth login from 2 providers to 6
  • OAuth providers (opens browser): Google, Microsoft, Exchange on-premises (EWS)
  • Credential providers (prompts for credentials): iCloud (app-specific password), Yahoo (app password, pre-filled IMAP host), IMAP (username, password, host, configurable port)
  • nylas init wizard now offers all 6 providers when connecting an email account
  • Credential-based auth uses POST /v3/connect/custom (same endpoint as Agent Accounts)
  • IMAP/SMTP ports default to 993/465 but user can override

Changes across 7 layers

Layer Files What
Domain provider.go Add ProviderEWS, ProviderICloud, ProviderYahoo
Port auth.go Add CreateCustomGrant to AuthClient
Adapter auth.go, mock/demo clients Implement CreateCustomGrant via /v3/connect/custom
Service service.go Add LoginWithCredentials (save grant + persist default)
CLI login.go Per-provider credential prompts, configurable ports
Init wizard wizard_helpers.go Offer all 6 providers during nylas init
Integration inbound_removed_test.go Update error message assertion

Test plan

  • go build ./... passes
  • Unit tests: adapter (4 new), service (3 new), CLI (3 new) — all pass
  • go test ./internal/cli/setup/ — 20 tests pass
  • Integration test TestCLI_AuthLoginRejectsInboxProvider updated and passing
  • Manual: nylas auth login --provider icloud → prompts for email + app password → grant created
  • Manual: nylas auth login --provider yahoo → prompts for email + app password → grant created
  • Manual: nylas auth login --provider imap → prompts for all fields including port → grant created
  • Manual: nylas auth login --provider ews → opens browser → OAuth flow completes

…providers

Extends nylas auth login from 2 providers (Google, Microsoft) to 6 by
adding credential-based authentication via POST /v3/connect/custom for
IMAP, iCloud, and Yahoo, plus OAuth support for Exchange on-premises (EWS).

Layers changed:
- domain: add ProviderEWS, ProviderICloud, ProviderYahoo constants
- ports: add CreateCustomGrant to AuthClient interface
- adapter: implement CreateCustomGrant on HTTPClient, MockClient, demo clients
- service: add LoginWithCredentials (saves grant + persists default)
- CLI: extend nylas auth login with per-provider credential prompts
- init wizard: offer all 6 providers during nylas init setup
- integration test: update error message assertion for new provider list
@qasim-nylas qasim-nylas requested a review from AaronDDM May 12, 2026 00:31
Copy link
Copy Markdown
Collaborator

@AaronDDM AaronDDM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@qasim-nylas qasim-nylas merged commit 20222ca into main May 12, 2026
6 checks passed
@qasim-nylas qasim-nylas deleted the feature/TW-4924-credential-based-auth branch May 12, 2026 00:35
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