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

Offen
#6,492 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
api, authentication, cli

Rechercherichtung

Beginnen Sie mit AuthenticationAccount in src/Microsoft.Management.Deployment/PackageManager.idl und verfolgen Sie dann die CLI-Optionen analog zu --authentication-mode und --authentication-account. Verfolgen Sie AuthenticationArguments bis zu AppInstaller::Authenticator und Authentication::AuthenticateForToken. Als abgeschlossen gilt die Aufgabe, wenn das externe Token über die CLI und die COM API bereitgestellt werden kann und von AuthenticateForToken zurückgegeben wird, wenn es vorhanden ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
C++
Sterne
26.6k
Forks
1.8k
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
41

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/winget-cli

Alle Issues in microsoft/winget-cli

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.