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

Ouverte
#6,492 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
cpp
Domaine
api, authentication, cli

Piste de recherche

Commencez par AuthenticationAccount dans src/Microsoft.Management.Deployment/PackageManager.idl, puis suivez les options de la CLI analogues à --authentication-mode et --authentication-account. Suivez AuthenticationArguments jusqu’à AppInstaller::Authenticator et Authentication::AuthenticateForToken. Le travail est terminé lorsque le token externe peut être fourni via la CLI et la COM API, et qu’il est renvoyé par AuthenticateForToken lorsqu’il est présent.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
C++
Étoiles
26.6k
Forks
1.8k
Merge moyen
3 j 10 h
PR mergées (30 j)
41

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de microsoft/winget-cli

Toutes les issues de microsoft/winget-cli

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.