aws / aws/amazon-q-developer-cli
bug: Headless login fails on Mac
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 2k
- Forks
- 439
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### Checks
- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
MacOsx (Sequoia)
### Expected behaviour
`q login` should work on a headless SSH session
### Actual behaviour
When trying to login with `q login` using a headless SSH session to my Mac - it fails on the OIDC call to `CreateToken` - I traced this back through the code-path and found that the `device_registration` is not persisting properly to the `secret_store`, when this [line](https://github.com/aws/amazon-q-developer-cli/blob/0497da7b6443481f2a1de28a132e94b4ed20b4e4/crates/fig_auth/src/builder_id.rs#L198) runs, an error is thrown :
```
SecKeychainItemModifyContent: User interaction is not allowed
```
As a result, the polling call for create-token creates a new client-registration - which obviously results in a `client_id` / `client_secret` that doesn't match the original call to `StartDeviceAuthorization` call - and the service errors. This effectively means I can't login to Q in headless mode.
### Steps to reproduce
(On Mac)
1. `ssh localhost`
2. `q login`
### Environment
```yaml
```
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in crates/fig_auth/src/builder_id.rs um Zeile 198 und untersuche, wie device_registration während `q login` im secret_store persistiert wird. Reproduziere dies mit `ssh localhost`, gefolgt von `q login`; erfolgreich ist es, wenn der headless Mac-Login ohne den Fehler `SecKeychainItemModifyContent` abgeschlossen wird und die Polling-Anfrage die ursprüngliche Geräte-Registrierung verwendet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- macos, rust
- Bereich
- authentication, cli
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100