我正在使用ASPNET 5 beta6,並且我得到了這個工作。
嘗試使用this已更新IApplicationBuilder
擴展名在Samples分支中找到了分支。重新調整的方法接受IdentityManagerOptions而非IdentityServerOptions
和編輯生成器來UseIdentityManager
總之,這裏是我的擴展方法是什麼樣子
public static class IApplicationBuilderExtensions
{
public static void UseIdentityManager(this IApplicationBuilder app, IdentityManagerOptions options)
{
app.UseOwin(addToPipeline =>
{
addToPipeline(next =>
{
var builder = new AppBuilder();
var provider = app.ApplicationServices.GetService<IDataProtectionProvider>();
builder.Properties["security.DataProtectionProvider"] =
new DataProtectionProviderDelegate(purposes =>
{
var dataProtection = provider.CreateProtector(string.Join(",", purposes));
return new DataProtectionTuple(dataProtection.Protect, dataProtection.Unprotect);
});
builder.UseIdentityManager(options);
var appFunc =
builder.Build(typeof (Func<IDictionary<string, object>, Task>)) as
Func<IDictionary<string, object>, Task>;
return appFunc;
});
});
}
}
請參閱從IdentityServer3這個樣本,其中IdentityManager實現:https://開頭的github .com/IdentityServer/IdentityServer3.Samples/tree/master/source/AspNetIdentity/SelfHost 很遺憾,這個示例已損壞。 –
@CorstianBoerman。感謝您的鏈接。在使用IdentityManager和Server(用於AspIdentoty)後,我發現底層問題是vNext與Identity3協同工作,而Identity Server和管理員仍然使用Identity 2.0。如果我錯了,請糾正我。再次,謝謝你的示例鏈接 – MRainzo
的確如此。我自言自語說,我已經讀過某處沒有支持asp.net 5的計劃,無論如何,它看起來已經改變了主意:https://github.com/IdentityManager/IdentityManager/issues/144 –