简体   繁体   English

删除具有.net core的Azure Active Directory上要求身份验证的弹出窗口

[英]Remove authentication required popup on Azure Active directory with .net core

I am using .net core 2.0 application with ADFS for authentication. 我使用带有ADFS的.net core 2.0应用程序进行身份验证。 When I access web app from linux, I get additional authentication required po up on office network. 当我从linux访问Web应用程序时,我在办公室网络上获得了需要的其他身份验证。 Pop up not asked in outside office network or office device. 在外部办公网络或办公设备中弹出询问。

在此处输入图片说明

i need to remove the additional popup or enter user credentials with Nightwatch automation test. 我需要删除其他弹出窗口或使用Nightwatch自动化测试输入用户凭据。

Neither Nightwatch nor underlying Selenium doesn't support interaction with this popup unfortunately, but what you can do is to pass username and password with URL: 不幸的是,Nightwatch和基础Selenium都不支持与此弹出窗口的交互,但是您可以做的是通过URL传递用户名和密码:

client
  .url('https://username:password@example.com')

Update: 更新:

The solution above won't work if the URL you open the first doesn't require auth (and looks like this is your case). 如果您打开的第一个URL不需要身份验证(看起来就是这种情况),则上述解决方案将无法使用。

What you can do, is to pre-authenticate browser before running actual test by visiting any URL which requires auth, so auth header will be added for every next request in this browser session. 您可以做的是,在运行实际测试之前通过访问任何需要身份验证的URL来对浏览器进行预身份验证,因此将为此浏览器会话中的每个下一个请求添加身份验证标头。 You might as well use before hook of your test suite: 您不妨before连接测试套件before使用:

module.exports = {
  before: function(client, done) {
    client.url('https://username:password@someurl.com/auth').perform(function() {
      done();
    });
  },
  ...
};

Another approach would be to create a custom browser profile which is already logged in. 另一种方法是创建已登录的自定义浏览器配置文件。

A useful discussion on how to pass a custom firefox profile: https://github.com/nightwatchjs/nightwatch/issues/1543 关于如何传递自定义firefox配置文件的有用讨论: https : //github.com/nightwatchjs/nightwatch/issues/1543

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Web API .Net Core Azure Active Directory身份验证 - Web API .Net Core Azure Active Directory Authentication Azure Active Directory -.Net Core 3 Web 应用程序 - 禁用 2 因素身份验证 - Azure Active Directory - .Net Core 3 Web Application - Disable 2 Factor Authentication Azure 使用 .net 核心 3.1 中的 azure 活动目录(单租户)的广告身份验证和授权? - Azure Ad authentication and authorization using azure active directory (single tenant) in .net core 3.1? ASP.NET中的Azure Active Directory身份验证 - Azure active directory authentication in asp.net 在 .Net Core 中将登录与 Azure Active Directory 集成 - Integrating Sign In with Azure Active Directory in .Net Core 现有Asp.Net核心应用程序中缺少与Azure Active Directory连接的服务的身份验证 - Authentication with Azure Active Directory connected services missing in existing Asp.Net core application ASP.NET Core MVC 6 Azure B2C Active Directory身份验证问题 - ASP.NET Core MVC 6 Azure B2C Active Directory Authentication issue 如何使用 Azure Active Directory 单点登录 MFA 身份验证与 dot net core web 应用程序 - How to Use Azure Active Directory Single sign on MFA authentication with dot net core web application 为什么Azure Active Directory身份验证会在ASP.NET Core应用程序中引起字符编码错误? - Why is Azure Active Directory Authentication causing an character encoding error in my ASP.NET Core Application? Azure Active Directory身份验证 - Azure Active Directory Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM