在IdentityServer4客户端OIDC中间件

时间:2018-03-12 18:03:45

标签: asp.net authentication forms-authentication identityserver4

我使用IdentityServer4作为身份验证服务器和ASP.NET MVC客户端。如果我在oidc中间件中抛出异常:

var tokenClient = new TokenClient(
                        IdentityServerHost + "/connect/token",
                        clientIdent,
                        secret);

                    var tokenResponse = await tokenClient.RequestAuthorizationCodeAsync(n.Code, n.RedirectUri);
                    throw new Exception("Something bad happened"); //I will put this in an if checking for tokenResponse.IsError, forcing it right now.

然后,不要从此行的Global.asax的Application_Error()方法中获取该异常:

Exception ec = Server.GetLastError();

我在那里遇到以下异常:{"路径控制器' /login.aspx'未找到或未实现IController。"}

我不确定为什么它突然想要回到我认为的Windows /表单身份验证或如何关闭它。有人有什么想法吗?

0 个答案:

没有答案
相关问题