我是IdentityServer3的新手,剛剛開始設置它。它似乎進行得相當順利,我一直在爲類似於Kevin Dockx的Pluralsight課程(http://www.pluralsight.com/courses/building-securing-restful-api-aspdotnet) 中顯示的MVC應用程序開發Hybrid流程,當時我嘗試配置帶有MVC錯誤的IdentityServer彈出 - Microsoft.IdentityModel.Protocols.OpenIdConnectProtocolException: invalid_request
帶有ServiceStack和MVC客戶端的IdentityServer3
ID服務器:
new Client
{
Enabled = true,
ClientName = "MVC Client (Hybrid Flow)",
ClientId = "mvc",
Flow = Flows.Hybrid,
RequireConsent = true,
RedirectUris = new List<string>
{"https://localhost:44358/"},
}
var scopes = new List<Scope>{
StandardScopes.OpenId,
StandardScopes.Profile
};
而下面是從MVC客戶端應用程序
public void Configuration(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies",
//CookieName = "ourcookiename"
});
var options = new OpenIdConnectAuthenticationOptions
{
ClientId = "mvc",
Authority = "https://localhost:44367/identity/",
RedirectUri = "https://localhost:44358/",
// PostLogoutRedirectUri = "https://localhost:44300/",
SignInAsAuthenticationType = "Cookies",
ResponseType = "code id_token token",
Scope = "openId profile"
};
app.UseOpenIdConnectAuthentication(options);
}
的代碼,也有與012配置 https://github.com/MacLeanElectrical/servicestack-authentication-identityserver`驗證服務,但在Global.aspx中爲新的AppHost()。Init();它顯示錯誤 -
'System.NullReferenceException' occurred in ServiceStack.dll but was not handled in user code
您需要打開日誌記錄 – leastprivilege