2016-05-06 61 views
0

我可以這樣來配置我的身份服務器客戶端Startup.cs我需要在Identity Server客戶端上進行哪些JWT驗證?

app.UseJwtBearerAuthentication(options => 
{ 
    options.Authority = Configuration["Urls:IdentityServer"]; 
    options.RequireHttpsMetadata = false; 

    options.Audience = Configuration["Urls:IdentityServer"] + "/resources"; 
    options.AutomaticAuthenticate = true; 
} 

這將採取所有推薦的智威湯遜驗證(簽名,隨機數等)或我寫我自己的任何驗證?

回答

1

您應該要求生產中的元數據使用HTTPS。

除了JWT中間件,您還需要進行範圍驗證。

+0

它們是IdentityServer GitHub示例中範圍驗證的樣本嗎? – sunil

+0

無需樣品 - 只需檢查您所期望的範圍說明和價值即可。 –

+0

如果我將此添加到startup.cs'app.UseMiddleware (新列表 {「myapi」});'它足夠嗎? – sunil

相關問題