artifacts-credprovider/build
John Schmeichel f5a44bd497
Create Microsoft.Artifacts.Authentication package (#388)
Proposed changes to pull the MSAL related types into their own project
and deliver as an extension to MSAL. Design and implementation are a
work in progress to collect feedback on the approach and API design.

Example usage of to create a PublicClientApplication with recommended
settings and defaults for Azure Artifacts and enumerate providers:

```csharp
var app = AzureArtifacts.CreateDefaultBuilder(authority)
    .WithBroker(true, logger)
    .WithLogging((LogLevel level, string message, bool containsPii) =>
    {
        // Application specific logging
    })
    .Build();

// Can use MsalTokenProviders which works for most cases, or compose the token providers manually
var providers = MsalTokenProviders.Get(app, logger);

var tokenRequest = new TokenRequest("https://pkgs.dev.azure.com/org")
{
    IsInteractive = true
};

foreach (var provider in providers)
{
    if (!provider.CanGetToken(tokenRequest))
        continue;

    var result = await provider.GetTokenAsync(tokenRequest);
}
```

1. Uses and extends the MSAL token types, and not trying to be a wrapper
around them. No plans to support more token authentication libraries in
the future.
2. Uses Microsoft.Extensions.Logging as the logging infrastructure, and
adaptors will be created where necessary to interface with client
tooling.
3. All settings and defaults are pulled out onto TokenRequest, or are
composable using extension methods.
2023-04-26 15:39:49 -07:00
..
build.yml Create Microsoft.Artifacts.Authentication package (#388) 2023-04-26 15:39:49 -07:00