1
我正嘗試在同一個啓動中共同承載identityserver3和web api(用於使用持票人令牌的用戶管理)。但是,我收到以下錯誤: 任務被取消。 當嘗試撥打http://identity_local/core/.well-known/openid-configuration(identity_local指向本地主機)時,似乎任務取消在啓動時發生。任務被取消
我啓動如下:
app.Map("/core", idsrvApp =>
{
var factory = new IdentityServerServiceFactory();
factory.UserService = new IdentityServer3.Core.Configuration.Registration<IUserService, UserService>();
factory.ScopeStore = new IdentityServer3.Core.Configuration.Registration<IScopeStore>(resolver => 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 =>
{
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);
});
有誰知道如果)有可能都在相同的啓動和b)如果是這樣,我做了什麼錯誤或我能做些什麼來有補救以上。
你是我的英雄!我正在尋找一個星期的解決方案。而簡單地設置'DelayLoadMetadata = TRUE;在'IdentityServerBearerTokenAuthenticationOptions'沒有的伎倆。這應該definitley被標記爲正確的答案。實際上它應該在IdentityServer3的入門演練中。 – Michael