问题描述
我开发了 asp.net mvc 应用程序(没有 .NET Core)。它使用带有自定义数据库的 WSFederationAuthenticationModule 实现来验证用户。现在我必须添加 Azure Active Directory 身份验证,并且在运行时我必须选择我应该使用哪种身份验证方法。
我设置了以下结构:
public class LoginInterceptorModule : IHttpModule
{
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.AuthorizeRequest += OnAuthorizeRequest;
}
private void OnAuthorizeRequest(object sender,EventArgs e)
{
var httApp = (HttpApplication)sender;
if (!httApp.Request.IsAuthenticated)
{
var user = httApp.Request.LogonUserIdentity.Name;
if (IsMIgratedToAzure(user))
{
// set azure identity provider
}
else
{
// set custom identity provider
}
}
}
private bool IsMIgratedToAzure(string username)
{
// put logic
return false;
}
}
我可以从这里继续吗?如果真是这样,那么是以哪种方式?如果没有,您对我有什么建议吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)