Hi, Yes, you could make this happen from a 3dsMax plugin point of view. There are different ways to handle it. You mentioned "clicking on my loaded 3ds Max plugin" which is a big vague. You could do it at 3ds Max startup by using a callback, or a certain plugin type (like GUP where it has startup methods where you could place the code). If you want it to be via a UI element, it can be part of any plugin really, and just hookup a button callback for example.
Although we are not here to support the Microsoft functionality, I see with quick search they are using oauth 2.0 and the MSAL is newest way. I suggest to follow newest always when it comes to authorization and security. With oauth, typically you can use REST and there are many ways to call REST from a plugin.
Looks like they also have some libraries, and is prefered way to use it.
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview
https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-v2-libraries
I did a quick check and see that they support python and .NET in terms of what 3ds Max also supports. Or if you want to make a C++ 3ds Max plugin, you could use a mixed-mode plugin and use the .NET library.
hope it helps,
kevin
Kevin Vandecar
Developer Technical Services
Autodesk Developer Network