我已经将我的MVC应用程序配置为以传统方式使用Forms身份验证.
<authentication mode="Forms">
<forms cookieless="UseCookies" slidingExpiration="true" timeout="1">
</forms>
</authentication>
Run Code Online (Sandbox Code Playgroud)
但是,我允许客户端选择他的Web应用程序如何进行身份验证(URL令牌/ Cookie),以及他的应用程序会话在到期之前应该持续多长时间(超时)
我有办法通过代码执行此操作吗?我只通过web.config看过这个的实现?
我想从数据库中读取设置并将它们应用于Global.asax - > OnApplicationStart()
我有这样的情况。
派生模块的基类。
每个模块都有自己的信号中心。
我想将所有模块托管在单个主机中,并按模块名称分隔。
某些模块将共享集线器名称。
namespace domain.com.base
{
public class BaseClass
{
public string ApplicationName;
}
}
namespace domain.com.billing
{
public class Billing : BaseClass
{
ApplicationName = "Billing";
}
public class NotificationHub : Hub
{
public void Credit(decimal amount)
{
Clients.All.Notify(amount);
}
}
}
namespace domain.com.reporting
{
public class Reporting : BaseClass
{
ApplicationName = "Reporting";
}
public class ReportingHub : Hub
{
public Report GetReport(int Id)
{
return ReportModule.RetrieveReport(Id);
}
}
}
Run Code Online (Sandbox Code Playgroud)
在OWIN.Startup.Configuration(IAppBuilder)中可以做这样的事情
namespace domain.com.external_access
{
public void …Run Code Online (Sandbox Code Playgroud)