Allow passing an external authentication token override instead of using the builtin authentication handler

Aperta
#6,492 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Inizia con AuthenticationAccount in src/Microsoft.Management.Deployment/PackageManager.idl, quindi segui le opzioni della CLI analoghe a --authentication-mode e --authentication-account. Segui AuthenticationArguments fino a AppInstaller::Authenticator e Authentication::AuthenticateForToken. Il lavoro è completato quando il token esterno può essere fornito tramite la CLI e la COM API e viene restituito da AuthenticateForToken quando è presente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area-COM-API Issue-Feature Possible-Duplicate PowerShell
Relevant area(s)

COM API, WinGet CLI, PowerShell Module

Description of the new feature / enhancement

Summary

Add a command line argument as well as COM API support to supply an external authentication token, overriding the default authentication flow.

Background

The builtin authentication support (AppInstaller::Authentication) currently either supports no authentication or the use of Entra ID authentication via WebAuthenticationCoreManager. This has some shortcomings with unattended deployments:

  • WebAuthenticationCoreManager has bugs involving running programs as different users (#6186). This can be worked around when using WebAuthenticationCoreManager directly by delegating the user authentication flow to a helper process, but this is not possible when using WinGet, as its API does not allow passing in an external token but requires using the builtin WebAuthenticationCoreManager flow.
  • There is no way to make system-wide unattended installations work without user interaction, as WinGet does not support requesting a machine token. This would also require the device to have a corresponding Entra ID principal via a device attach / join.
  • --authentication-mode silent is not useful for unattended deployments as it does not guarantee success - after all, the user must have authenticated themselves at some point. It also requires WinGet to run as the user, not as LocalSystem, which isn't possible with users not having administrator access and the installer requiring elevation.

In our case, a user should be able to order software and have it installed without further interaction via our client management solution, where the software resides in a private WinGet repository protected from unauthorized access via Entra ID authentication - we don't need to authenticate as the user, we need to authenticate as an Entra ID principal we can grant access to, but WinGet doesn't allow for external authentication flows.

Proposed technical implementation details
  • Extend AuthenticationAccount with String AuthenticationToken;.
  • Extend the CLI interface with --authentication-token akin to --authentication-mode and --authentication-account.
  • Pass both values to AppInstaller::Authenticator as part of the AuthenticationArguments.
  • Adjust AppInstaller::Authentication::AuthenticateForToken to return the token from the authentication arguments, if present.
Lingua principale
C++
Stelle
26.6k
Fork
1.8k
Merge medio
3g 10h
PR unite (30g)
41

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/winget-cli

Tutte le issue di microsoft/winget-cli

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.