Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Login with Multi-Factor Authentication #735

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class Navigation
public static string AreaMoreMenu = "Nav_AreaMoreMenu";
public static string SubAreaContainer = "Nav_SubAreaContainer";
public static string WebAppMenuButton = "Nav_WebAppMenuButton";
public static string UCAppMenuButton = "Nav_UCAppMenuButton";
public static string UCIAppMenuButton = "Nav_UCIAppMenuButton";
public static string SiteMapLauncherButton = "Nav_SiteMapLauncherButton";
public static string SiteMapLauncherCloseButton = "Nav_SiteMapLauncherCloseButton";
public static string SiteMapAreaMoreButton = "Nav_SiteMapAreaMoreButton";
Expand Down Expand Up @@ -265,7 +265,7 @@ public static class AppElements
{ "Nav_AreaMoreMenu" , "//ul[@role=\"menubar\"]"},
{ "Nav_SubAreaContainer" , "//*[@data-id=\"navbar-container\"]/div/ul"},
{ "Nav_WebAppMenuButton" , "//*[@id=\"TabArrowDivider\"]/a"},
{ "Nav_UCAppMenuButton" , "//button[@data-id=\"navbar-switch-app\"]"},
{ "Nav_UCIAppMenuButton" , "//button[@data-id=\"navbar-switch-app\"]"},
{ "Nav_SiteMapLauncherButton", "//button[@data-lp-id=\"sitemap-launcher\"]" },
{ "Nav_SiteMapLauncherCloseButton", "//button[@aria-label=\"Close Site Map\"]" },
{ "Nav_SiteMapAreaMoreButton", "//button[@data-lp-id=\"sitemap-areaBar-more-btn\"]" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ public static class Elements
{ "Login_Password", "//input[@type='password']"},
{ "Login_SignIn", "id(\"cred_sign_in_button\")"},
{ "Login_CrmMainPage", "//*[contains(@id,'crmTopBar')or contains(@data-id,'topBar')]"},
{ "Login_CrmUCMainPage", "//*[contains(@data-id,'topBar')]"},
{ "Login_CrmUCIMainPage", "//*[contains(@data-id,'topBar')]"},
{ "Login_StaySignedIn", "//input[@id=\"idSIButton9\"]"},
{ "Login_OneTimeCode", "//input[@name='otc']"},


//Notification
{ "Notification_AppMessageBar", "id(\"crmAppMessageBar\")"},
Expand Down Expand Up @@ -724,8 +726,9 @@ public static class Login
public static string LoginPassword = "Login_Password";
public static string SignIn = "Login_SignIn";
public static string CrmMainPage = "Login_CrmMainPage";
public static string CrmUCMainPage = "Login_CrmUCMainPage";
public static string CrmUCIMainPage = "Login_CrmUCIMainPage";
public static string StaySignedIn = "Login_StaySignedIn";
public static string OneTimeCode = "Login_OneTimeCode";
}
public static class Report
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public void Login(Uri orgUrl)
/// <param name="orgUrl">URL of the organization</param>
/// <param name="username">User name</param>
/// <param name="password">Password</param>
public void Login(Uri orgUrl, SecureString username, SecureString password)
/// <param name="mfaSecrectKey">SecrectKey for multi-factor authentication</param>
public void Login(Uri orgUrl, SecureString username, SecureString password, SecureString mfaSecrectKey = null)
{
_client.Login(orgUrl, username, password);
_client.Login(orgUrl, username, password, mfaSecrectKey);

_client.InitializeModes();
}
Expand All @@ -45,10 +46,11 @@ public void Login(Uri orgUrl, SecureString username, SecureString password)
/// <param name="orgUrl">URL of the organization</param>
/// <param name="username">User name</param>
/// <param name="password">Password</param>
/// <param name="mfaSecrectKey">SecrectKey for multi-factor authentication</param>
/// <param name="redirectAction">Actions required during redirect</param>
public void Login(Uri orgUrl, SecureString username, SecureString password, Action<LoginRedirectEventArgs> redirectAction)
public void Login(Uri orgUrl, SecureString username, SecureString password, SecureString mfaSecrectKey, Action<LoginRedirectEventArgs> redirectAction)
{
_client.Login(orgUrl, username, password, redirectAction);
_client.Login(orgUrl, username, password, mfaSecrectKey, redirectAction);

_client.InitializeModes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Otp.NET, Version=1.2.1.0, Culture=neutral, PublicKeyToken=38a48df817e173a6, processorArchitecture=MSIL">
<HintPath>..\packages\Otp.NET.1.2.1\lib\net45\Otp.NET.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
Expand Down
Loading