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

MFA secret key issue #1414

Open
DotaABhash opened this issue Mar 27, 2024 · 8 comments
Open

MFA secret key issue #1414

DotaABhash opened this issue Mar 27, 2024 · 8 comments
Labels

Comments

@DotaABhash
Copy link

@Shakevg can you please help me out on this... thankyou
I was trying to bypass MFA in one of my CRM application using the secret key, I did everything right the steps ask to, but it seems to be stuck on the OTP screen can you please help me out ....
image
image

@Shakevg
Copy link
Contributor

Shakevg commented Mar 27, 2024

Framework doesn't support such a method with push notification.
But the workaround may be (It will require some code update, you can do it locally):

  1. Click 'I can't use my Microsoft Authenticator app right now' link
  2. Select 'Use a verification code'
    image
  3. Type code

@DotaABhash
Copy link
Author

thankyou @Shakevg i changed it to verification code and it is working fine now. Also, i have this issue while delete a Lead it gives out an error indicating it cannot find the element. Is it xpath issue ? i tried using the xpath inspecting the browser but did not find a match, so i tried my own xpath and still got the same error. Can you plz help me out on this as well .... thankyou [my xpath: //div[@Class='ms-StackItem truncatableText-409']]
Message: 
Test method Microsoft.Dynamics365.UIAutomation.Sample.UCI.UpdateLeadUCI.UCITestUpdateActiveLead threw exception:
OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@tabindex='0' and @ROLE='checkbox']"}
(Session info: MicrosoftEdge=123.0.2420.53)

Stack Trace: 
BrowserCommand1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) line 140 BrowserCommand1.Execute(IWebDriver driver) line 35
BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) line 182
WebClient.OpenRecord(Int32 index, Int32 thinkTime, Boolean checkRecord) line 1535
Grid.OpenRecord(Int32 index) line 32
UpdateLeadUCI.UCITestUpdateActiveLead() line 35
image
image

@Shakevg
Copy link
Contributor

Shakevg commented Mar 28, 2024

DotaABhash Are you using develop branch?

@DotaABhash
Copy link
Author

@Shakevg yes i am using develop branch...

@NikitaShah24
Copy link

@Shakevg will you please help with this?
I was trying to bypass MFA in one of my CRM application using the secret key, I did everything right the steps ask to, but it seems to be stuck on the OTP screen can you please help me out ....

I get this screen even though I have added my mfasecret key in app.config file.

image

and my app.config file looks like this

image

and here is the code for that

public void Login(Uri orgUrl, SecureString username, SecureString password, SecureString mfaSecretKey)
{
var otpKeyStr = "6jm7n6xwitpjooh7ihewyyzeux7aqmw2";
SecureString sec_pass = new SecureString();
Array.ForEach(otpKeyStr.ToArray(), sec_pass.AppendChar);
sec_pass.MakeReadOnly();
var otpKeyBytes = Base32Encoding.ToBytes(otpKeyStr);
var otp = new Totp(otpKeyBytes);
var twoFactorCode = otp.ComputeTotp().ToSecureString(); // <- got 2FA coed at this time!
LoginResult result = _client.Login(orgUrl, username, password, twoFactorCode);
if(result == LoginResult.Failure)
throw new InvalidOperationException("Login Failure, please check your configuration");

 _client.InitializeModes();

}

@Shakevg
Copy link
Contributor

Shakevg commented May 10, 2024

I see there is no link "'I can't use my Microsoft Authenticator app right now' link" on screen.

NikitaShah24 Can you change MFA method from push to code in MS account settings?
What app do you use for MFA? Can you change it to MS authenticator?

@NikitaShah24
Copy link

Hello @Shakevg I am using microsoft authenticator but in my options there is no code option I can choose. The only options I have is, phone or app authenticator.

@Shakevg
Copy link
Contributor

Shakevg commented May 11, 2024

I suppose it is not possible to login using EasyRepro on this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants