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());
        }