Example #1
0
 public WeatherForecastService(
     ITokenAcquisition token,
     IConfiguration config,
     MicrosoftIdentityConsentAndConditionalAccessHandler handler)
 {
     _tokenAcquisition = token;
     _config           = config;
     _handler          = handler;
 }
Example #2
0
        public HomeController(ILogger <HomeController> logger,
                              IConfiguration configuration,
                              GraphServiceClient graphServiceClient,
                              MicrosoftIdentityConsentAndConditionalAccessHandler consentHandler)
        {
            _logger              = logger;
            _graphServiceClient  = graphServiceClient;
            this._consentHandler = consentHandler;

            _graphScopes = configuration.GetValue <string>("DownstreamApi:Scopes")?.Split(' ');
        }
        public Api02Service(IConfiguration configuration, HttpClient httpClient,
                            ITokenAcquisition tokenAcquisition,
                            MicrosoftIdentityConsentAndConditionalAccessHandler handler)
        {
            this.httpClient       = httpClient;
            this.tokenAcquisition = tokenAcquisition;
            this.handler          = handler;

            httpClient.BaseAddress = new Uri(configuration["AzureAd:Api02BaseAddress"]);
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            api2Scopes = new[] { configuration["AzureAd:Api02Scope"] };
        }
Example #4
0
        public HomeController(ILogger <HomeController> logger,
                              IConfiguration configuration,
                              GraphServiceClient graphServiceClient,
                              MicrosoftIdentityConsentAndConditionalAccessHandler consentHandler)
        {
            _logger              = logger;
            _graphServiceClient  = graphServiceClient;
            this._consentHandler = consentHandler;

            // Capture the Scopes for Graph that were used in the original request for an Access token (AT) for MS Graph as
            // they'd be needed again when requesting a fresh AT for Graph during claims challenge processing
            _graphScopes = configuration.GetValue <string>("DownstreamApi:Scopes")?.Split(' ');
        }
Example #5
0
 public TodoListController(ITodoListService todoListService,
                           MicrosoftIdentityConsentAndConditionalAccessHandler consentHandler)
 {
     _todoListService     = todoListService;
     this._consentHandler = consentHandler;
 }
Example #6
0
 public _HostModel(MicrosoftIdentityConsentAndConditionalAccessHandler conditionalAccessHandler, GraphServiceClient graphServiceClient)
 {
     _conditionalAccessHandler = conditionalAccessHandler;
     _graphServiceClient       = graphServiceClient;
 }