コード例 #1
0
        /// <summary>
        /// Create device code provider with callback
        /// </summary>
        /// <param name="store"></param>
        /// <param name="prompt"></param>
        /// <param name="config"></param>
        /// <param name="logger"></param>
        public DeviceCodeTokenProvider(IDeviceCodePrompt prompt,
                                       IClientConfig config, ITokenCacheProvider store, ILogger logger)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _config = config ?? throw new ArgumentNullException(nameof(config));
            _prompt = prompt ?? throw new ArgumentNullException(nameof(prompt));
            _store  = store ?? DefaultTokenCacheProvider.Instance;

            if (string.IsNullOrEmpty(_config.AppId))
            {
                _logger.Error("Device code token provider was not configured with " +
                              "a client id.  No tokens will be obtained.");
            }
        }
コード例 #2
0
 /// <summary>
 /// Create device code provider with callback
 /// </summary>
 /// <param name="prompt"></param>
 /// <param name="config"></param>
 /// <param name="logger"></param>
 public MsalDeviceCodeClient(IDeviceCodePrompt prompt,
                             IClientAuthConfig config, ILogger logger) : base(config, logger)
 {
     _prompt = prompt ?? throw new ArgumentNullException(nameof(prompt));
 }
コード例 #3
0
 /// <inheritdoc/>
 public CliAuthenticationProvider(IDeviceCodePrompt prompt,
                                  IClientConfig config, ITokenCacheProvider store, ILogger logger)
 {
     _vs = new VsAuthenticationProvider(config);
     _dc = new DeviceCodeTokenProvider(prompt, config, store, logger);
 }