A task was canceled
<p>I am trying to co-host identityserver3 and web api (for user management using Bearer tokens) in the same startup. However I get the following error:
A task was canceled.
It appears the task cancellation occurs on startup when trying to call <a href="http://identity_local/core/.well-known/openid-configuration" rel="nofollow">http://identity_local/core/.well-known/openid-configuration</a> (identity_local points to localhost).</p>

<p>My startup is as follows:</p>

<pre><code>app.Map("/core", idsrvApp =&gt;
        {
            var factory = new IdentityServerServiceFactory();
            factory.UserService = new IdentityServer3.Core.Configuration.Registration&lt;IUserService, UserService&gt;();
            factory.ScopeStore = new IdentityServer3.Core.Configuration.Registration&lt;IScopeStore&gt;(resolver =&gt; scopeStore);
            var options = new IdentityServerOptions
            {
                SigningCertificate = Certificate.Load(),
                IssuerUri = "http://identity_local/core",
                PublicOrigin = "http://identity_local",
                RequireSsl = false, //for now
                Factory = factory,
            };

            idsrvApp.UseIdentityServer(options);
        });

        app.Map("/admin", adminApp =&gt;
        {
            adminApp.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
            {
                Authority = "http://identity_local/core",
                IssuerName = "identity_local",
                ValidationMode = ValidationMode.Local,
                RequiredScopes = new[] { "api", "roles" }
            });

            adminApp.UseResourceAuthorization(new AuthorisationManager());

            var config = new HttpConfiguration();
            config.MapHttpAttributeRoutes();

            adminApp.UseCors(CorsOptions.AllowAll);
            adminApp.UseWebApi(config);

        });
</code></pre>

<p>Does anyone know if a) it is possible to have both in the same startup and b) if so, what have I done wrong or what can I do to remedy the above.</p>