private static void BindCommandLineScopes(AcquireTokenOptions options, ParseResult parseResult) { var scopesOptionResult = parseResult.CommandResult.Children .OfType <OptionResult>() .FirstOrDefault(r => r.Symbol.Name == nameof(options.Scopes)); if (scopesOptionResult?.GetValueOrDefault() is IEnumerable <string> scopes) { options.Scopes.AddRange(scopes); } }
public DeviceCodeCommandExecutor( ClientApplicationFactory clientApplicationFactory, IOptions <AcquireTokenOptions> acquireTokenOptions, ILoggerFactory?loggerFactory = null) : base(clientApplicationFactory, loggerFactory) { this.acquireTokenOptions = acquireTokenOptions?.Value ?? throw new ArgumentNullException(nameof(acquireTokenOptions)); loggerFactory ??= Microsoft.Extensions.Logging.Abstractions .NullLoggerFactory.Instance; string deviceCodeCategory = typeof(DeviceCodeResult).Namespace + "." + nameof(DeviceCodeResult.DeviceCode); deviceCodeLogger = loggerFactory.CreateLogger(deviceCodeCategory); deviceCodeResultCallback = DeviceCodeUserInteractionCallback; }