- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Multi-Tenancy 应用程序,其中每个租户都可以为 WsFed 或 OpenIdConnect(Azure) 或 Shibboleth(Kentor) 定义自己的元数据 URl、ClientId、权限等。所有租户都存储在DB表中并在OwinStartup中注册,如下所示:
// Configure the db context, user manager and signin manager to use a single instance per request
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
// Configure the sign in cookie
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
// CookieName = "Kuder.SSO",
LoginPath = new PathString("/Account/Login-register"),
Provider = new CookieAuthenticationProvider
{
//Enables the application to validate the security stamp when the user logs in.
//This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
OrganizationModel objOrg = new OrganizationModel();
var orgList = objOrg.GetOrganizationList();
foreach (OrganizationModel org in orgList)
{
switch (org.AuthenticationName)
{
case "ADFS":
WsFederationAuthenticationOptions objAdfs = null;
objAdfs = new WsFederationAuthenticationOptions
{
AuthenticationType = org.AuthenticationType,
Caption = org.Caption,
BackchannelCertificateValidator = null,
MetadataAddress = org.MetadataUrl,
Wtrealm = org.Realm,
SignOutWreply = org.Realm,
Notifications = new WsFederationAuthenticationNotifications
{
AuthenticationFailed = context =>
{
context.HandleResponse();
Logging.Logger.LogAndEmailException(context.Exception);
context.Response.Redirect(ConfigurationManager.AppSettings["CustomErrorPath"].ToString() + context.Exception.Message);
return Task.FromResult(0);
}
},
TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false },
};
app.UseWsFederationAuthentication(objAdfs);
break;
case "Azure":
OpenIdConnectAuthenticationOptions azure = null;
azure = new OpenIdConnectAuthenticationOptions
{
AuthenticationType = org.AuthenticationType,
Caption = org.Caption,
BackchannelCertificateValidator = null,
Authority = org.MetadataUrl,
ClientId = org.IDPProvider.Trim(),
RedirectUri = org.Realm,
PostLogoutRedirectUri = org.Realm,
Notifications = new OpenIdConnectAuthenticationNotifications
{
AuthenticationFailed = context =>
{
context.HandleResponse();
Logging.Logger.LogAndEmailException(context.Exception);
context.Response.Redirect(ConfigurationManager.AppSettings["CustomErrorPath"].ToString() + context.Exception.Message);
return Task.FromResult(0);
}
},
TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = false },
};
app.UseOpenIdConnectAuthentication(azure);
break;
case "Shibboleth":
var english = CultureInfo.GetCultureInfo("en-us");
var organization = new Organization();
organization.Names.Add(new LocalizedName("xxx", english));
organization.DisplayNames.Add(new LocalizedName("xxx Inc.", english));
organization.Urls.Add(new LocalizedUri(new Uri("http://www.aaa.com"), english));
var authServicesOptions = new KentorAuthServicesAuthenticationOptions(false)
{
SPOptions = new SPOptions
{
EntityId = new EntityId(org.Realm),
ReturnUrl = new Uri(org.Realm),
Organization = organization,
},
AuthenticationType = org.AuthenticationType,
Caption = org.Caption,
SignInAsAuthenticationType = "ExternalCookie",
};
authServicesOptions.IdentityProviders.Add(new IdentityProvider(
new EntityId(org.IDPProvider), authServicesOptions.SPOptions)
{
MetadataLocation = org.MetadataUrl,
LoadMetadata = true,
SingleLogoutServiceUrl = new Uri(org.Realm),
});
app.UseKentorAuthServicesAuthentication(authServicesOptions);
break;
default:
break;
}
}
当在 Db 中启用同一提供商的多个组织(ADFS、Azure 或 Shibboleth)时,我收到错误。我尝试“app.Map”来扩展它。但还是没有成功。另外,我使用下面的代码注销所有提供程序(ADFS 和 Azure),但注销也失败。
提供商是我在组织中使用的唯一身份验证类型。
HttpContext.GetOwinContext().Authentication.SignOut(provider, Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ApplicationCookie, DefaultAuthenticationTypes.ExternalCookie);
寻求帮助/指导。注意:每当添加新租户时,我可以回收应用程序域,不需要动态重建管道以使事情变得复杂。
最佳答案
Kentor.AuthServices 中间件支持多个实例,但您需要为每个实例分配特定的 ModulePath
。如果没有这个,第一个 Kentor.AuthServices 中间件将处理所有传入请求,并对来自使用其他实例配置的 IdentityProvider 的消息抛出错误。
我知道其他一些 Katana 提供程序具有在回调期间使用的类似“隐藏”端点,但我不知道加载多个中间件实例时它们的行为方式。
作为一种替代方案,Kentor.AuthServices 中间件还支持向一个实例注册多个身份提供商。然后,您可以在运行时将 IdentityProvider 实例添加和移动到 KentorAuthServicesAuthenticationOptions
并使其立即生效。但是,如果您为每个租户使用一个中间件用于其他协议(protocol),那么这可能不是理想的解决方案。
关于azure - 使用 OWIN Pipeline 进行 Multi-Tenancy 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37931580/
例如,如果运行 1 正在等待批准并触发运行 2,则应拒绝运行 1。 最佳答案 “待批准”状态具体来自 Approval Gates功能。 虽然您不能在触发新运行时明确拒绝“待批准”步骤,但您可以通过在
在 Azure DevOps Pipelines 中,似乎有两种我无法区分的概念和处理“工件”的方法。 管道工件 https://learn.microsoft.com/en-us/azure/dev
不确定是否有办法做到这一点,但我想查看之前运行的 yaml 管道中的参数,以便查看管道运行时输入或选择的内容。那可能吗?我发现的唯一解决方法是根据每个参数添加标签。 最佳答案 您可以从 Build 查
我正在运行我所有的测试用例,其中一些用例有时会失败,管道检测到它并使步骤和构建失败。这会阻止要执行的下一步(压缩报告文件夹)。我想将该 zip 文件作为电子邮件附件发送。 这是我的 bitbucket
我正在数据工厂中定义管道,我纠正了一些错误。第一个事件是调用 usql 脚本进行一些聚合,我更改了脚本很多时间,但错误仍然是: [{"errorId":"E_CSC_USER_SYNTAXERROR"
我正在尝试使用运行命令VSTS扩展名对VSTS版本定义执行helm命令,但问题是它无法在我配置的自定义生成代理上找到kubeconfig文件。我认为这是因为定义的构建步骤在单独的过程中运行。当我运行
我无法弄清楚 sklearn.pipeline.Pipeline 是如何工作的。 doc 中有一些解释.例如它们是什么意思: Pipeline of transforms with a final e
我在 azure 管道中有两个管道(也称为“构建定义”),一个正在执行系统测试,一个正在执行性能测试。两者都使用相同的测试环境。我必须确保系统测试管道运行时不会触发性能管道,反之亦然。 到目前为止我已
我遵循了这个指令 https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.ht
当使用 YAML 完成另一个管道时尝试触发 Azure 管道。有documentation表明您可以添加管道资源: resources: # types: pipelines | builds |
我正在尝试根据我发布到的每个环境对我的 Web.config 进行文件转换。大多数情况下,一切看起来都很好,直到我在发布管道上部署到我的 UAT 阶段。 在我的构建管道中,这是我正在使用的 YAML
脚本化管道中是否有任何方法可以将某个阶段标记为不稳定,但仅将该阶段显示为不稳定,而不在输出中将每个阶段标记为不稳定? 我可以做这样的事情: node() { stage("Stage1") {
我有针对特定环境(dev、qa、uat)的特定配置文件和另一个根 web.config。部署的代码读取 web.config。所以我一直在尝试复制内容或重命名 Azure Pipelines 中的文件
我的 Jenkins 中有很多 Pipeline 项目。我想将它们转换为多分支管道。是否可以不删除管道并创建新的多分支管道?怎么办? 最佳答案 假设您的管道位于 Jenkinsfile 中,则无需进行
我们正在使用扩展功能以安全的方式在我们的管道中重用模板。为了更轻松地定义模板的参数,我想使用变量,但我觉得这是不可能的。 但由于我在官方文档中找不到答案,所以我在这一轮提问。 我的 yml 文件如下所
如何访问UID Jenkins 管道工作中的变量? 我收到了 null什么时候: pipeline { agent any environment { def user
我正在摆弄管道以尝试减少整体运行时间。我想做的一件事是执行 docker pull ...在开始时,以便以后,当我真正需要它时,它已经为我准备好了。我想将它作为后台工作解雇,并让它在该任务结束后继续存
From here我了解到 Bitbucket Pipeline 支持 ifs 语句。 如何在 if 语句中执行多行块? 这不计算: script: - if [ $BITBUCK
我在运行 Jenkins 服务器(在 docker 容器内)的谷歌云中运行虚拟机。我正在尝试为我的应用程序构建一个 Docker 镜像,并使用 Jenkins 管道将其推送到 Google Conta
在构建和部署 docker image.Getting Unexpected value 'Steps' 在第 27 行之前,我试图将视频文件从 GPM 复制到 app/dist/asset/imag
我是一名优秀的程序员,十分优秀!