I'm guessing that this is related to Azure Active Directory authorisation. Here's a good overview of the authorisation flow:
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
The flow can be different depending on whether it's a web/desktop/mobile, and if it's a single-page-application then it's a bit different again:
https://learn.microsoft.com/en-us/azure/active-directory/develop/authentication-flows-app-scenarios#scenarios-and-supported-authentication-flows
Once you have an idea of the scenario that suits your use case you can find some example projects on this page:
https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code
I'd recommend just cloning the repo and having a play around with the examples.