What you are trying to do is completely wrong - why to reverse-engineer frontend app and one day to find that everything changed?

There is official REST API to ms outlook online and authentication mechanism via Azure AD - exactly to let third-party apps to work with MS online apps.

Try to checkout this:

https://learn.microsoft.com/en-us/graph/overview-major-services

and this:

https://learn.microsoft.com/en-us/graph/azuread-identity-access-management-concept-overview

Answer from Andrey on Stack Overflow
🌐
Microsoft
account.microsoft.com › account
Microsoft account | Sign In or Create Your Account Today – Microsoft
Sign In with your Microsoft account. One account. One place to manage it all. Welcome to your account dashboard.
Sign in
Account Checkup Wizard
Sign In or Create Your Account Today
Sign In with your Microsoft account. One account. One place to manage it all. Welcome to your account dashboard.
Microsoft Account Privacy Settings
Microsoft allows you to control your account your way with customizable privacy settings. Manage your Xbox, Windows, and other privacy settings on this page.
Microsoft account
To use everything on this website, turn on cookies in your browser settings. Read why and how we use cookies
Top answer
1 of 2
2

What you are trying to do is completely wrong - why to reverse-engineer frontend app and one day to find that everything changed?

There is official REST API to ms outlook online and authentication mechanism via Azure AD - exactly to let third-party apps to work with MS online apps.

Try to checkout this:

https://learn.microsoft.com/en-us/graph/overview-major-services

and this:

https://learn.microsoft.com/en-us/graph/azuread-identity-access-management-concept-overview

2 of 2
0

POSTing to https://login.microsoftonline.com/kmsi will return a html with all the values you need:

<html>

<head>
    <title>Working...</title>
</head>

<body>
    <form method="POST" name="hiddenform" action="https://admin.microsoft.com/landing">
        <input type="hidden" name="code" value="0.AVwAAmogKpXYg0-1rfltzzT6ZQYAAAAAAPEPzgAAAAAAAAABAAA.AgABAAIAAAD--DLA3VO7QrddgJg7WevrAgDs_wQA9P-gWiQqeCHo-9FEKAxJ1WYio4IwurbBrT2hB561ujjKXXdH08Yoqwrn7KlDJ2Ybp0SP7VNeX0v0313oQy9u184OF9SUmmPCM9AqRp8cW_Oh9AhenJEP8ZThY680N5XdQ_xvTaxCdyu0G2rMld7Yp-fnmKxQsr3UrdysQW6qe9mEXX_IsUYecF46BYO2kh7XsLGLXDDdm1ZJa46G_wAN00fYPmxgH4dlsauqK0URhVxVFZrws3yuPWTJEn5VNhL2Z2cUdsFfBEAFdHDrjOujdxzJKbfqln2GqLcNP_3LdgHKx-atrIM7JXJfp_oJeKCwXwvK6tUa4bhvEotIeGhES_l_0kxOZQDIbBMU2yUoBYrn17fxUmTAOt-HpeYRQFYr4bymdVnRsfMINZCSbD-lOaW6oh-cvWYpxqbq8ZZ3tZ7OJzZKetSNtAwplcUjZZchysueXy3-t7u2nr8k27jrSe2DudpGcn1GY25kkGQyz-SiqVm70RsKT9Fb6lxoSm7I8zpAWfFnLZJtxYhddHRx4tA521wAXoXOhBZyc5I7_gZYk2a50QcxeJI0K88mXxyPNvndN4F8eCtRYp1X53LSFgs4XyJ2UzWo9LXsWZ_77Fz7Ivlz2n4AEZXVZlE_PnqYylRdOWDV2NdpBhgFB53geIEuiX9t4JVl0o8TdpPrYjgsiqGmtbg3ZO4J4c_CDLOzBBJemdpAEnkukRVKHt-ZcXKwMfWHjWmEi0p6Ji1GI92f0UO_ZTpUdXScKC4UQsPrWAU" />
        <input type="hidden" name="id_token" value="[TOKENVALUE]" />
        <input type="hidden" name="state" value="OpenIdConnect.AuthenticationProperties=78qNGNcn8xtuLU4P5T0Dz5QMprE4YNYcSnczbXtwxwZL-dMfErfi6EuAkBJw0mFDmV_sQY7Q3av60KFahCPqhj6hzPR_JtBiYotBBoHd0zSKjqM7HgdD_QMhKZKReePeYsiTgLZtXAcNmzRBdjtpeflCa4TTRQY7tqOvN2kOUZY" />
        <input type="hidden" name="session_state" value="16f47f33-cf2e-4300-9a9b-72276bd518f0" />
        <input type="hidden" name="correlation_id" value="1a7d67ed-2db0-44ea-a351-f9d70ff14229" />
        <noscript>
            <p>Script is disabled. Click Submit to continue.</p><input type="submit" value="Submit" />
        </noscript>
    </form>
    <script language="javascript">
    document.forms[0].submit();
    </script>
</body>

</html>

You must extract the values of each input and use it on the https://www.office.com/landing. Do not forget to encode the state value

🌐
Microsoft
login.microsoftonline.com › jsdisabled
Something went wrong
We can't sign you in · JavaScript is required to sign in. Your browser either does not support JavaScript or it is being blocked · Enable JavaScript in your browser or use one which supports it · Terms of use Privacy & cookies
Find elsewhere
🌐
Google Groups
groups.google.com › g › zaproxy-users › c › P4aBaDQr6MQ
Microsoft Login Authentication
7. Browser makes another POST requests to this url for a reason that I didn't really understand :) https://login.microsoftonline.com/kmsi
🌐
Reddit
reddit.com › r/microsoft › is login.microsoftonline.com a legit address?
r/microsoft on Reddit: Is login.microsoftonline.com a legit address?
March 4, 2024 -

I have noticed the different URL and I'm wondering why this is different from the usual login.live page. I've noticed it is normally tied to Microsoft services so I never logged in through this URL, but wanted to ask if this is a legit Microsoft domain.

🌐
Stack Overflow
stackoverflow.com › questions › 68793968 › how-pass-login-microsoftonline-com-authentication
.net - How pass login.microsoftonline.com authentication? - Stack Overflow
Did you try this ? stackoverflow.com/a/41058049/4836581 Also you can try adding &[email protected] to the URL - for username only.
🌐
Microsoft
office.com
Login | Microsoft 365 Copilot
[*] Copilot in the Microsoft 365 Copilot app is available for Microsoft 365 Enterprise, Academic, and SMB subscribers with a work or education account. Microsoft 365 Personal and Family subscribers and free accounts can access Copilot at copilot.microsoft.com and on the Copilot mobile app
🌐
Microsoft
myaccount.microsoft.com
My Account
You need to enable JavaScript to run this app
🌐
Det
fs.det.nsw.edu.au › adfs › ls
Browser SSO
JavaScript is required. This web browser does not support JavaScript or JavaScript in this web browser is not enabled · To find out if your web browser supports JavaScript or to enable JavaScript, see web browser help
🌐
Microsoftonline
login.microsoftonline.us
Microsoft Azure Government
We cannot provide a description for this page right now
🌐
Dynamics Community
community.dynamics.com › forums › thread › details
My iFrame displays login.microsoftonline.com refused to connect
Our D365 app presents an iframe on a form which loads another website (different domain) which conducts some Q and A then returns to a 'completed' page which is a D365 webresource html page · This works most of the time but occasionally we see 'login.microsoftonline.com refused to connect' ...
🌐
Brave Community
community.brave.app › browser support › desktop support
Https://login.microsoftonline.com/ redirects to google sign in - Desktop Support - Brave Community
February 4, 2025 - Description of the issue: When i log in to my company microsoft log in https://login.microsoftonline.com/ it redirects me to a google sign in page How can this issue be reproduced? sign in to https://login.microsoftonline.com/ Expected result: I expect to be signed in to the campany webpage/service i’m trying to access like on any other browser.