private HttpClient CreateClient(ClaimsPrincipal principal, IEnumerable<string> allowedScopes)
        {
            var startup = new PrimaryAuthenticationStartup(principal, allowedScopes);
            var server = TestServer.Create(null, startup.Configure, startup.ConfigureServices);

            return server.CreateClient();
        }
コード例 #2
0
        private HttpClient CreateClient(ClaimsPrincipal principal, IEnumerable <string> allowedScopes)
        {
            var startup = new PrimaryAuthenticationStartup(principal, allowedScopes);
            var server  = new TestServer(new WebHostBuilder()
                                         .Configure(startup.Configure)
                                         .ConfigureServices(startup.ConfigureServices));

            return(server.CreateClient());
        }