Implementation of OAuth 2.0 using Authorization code grant flow

<add key="ida:ClientId" value="[Enter client ID as obtained from Azure Portal, e.g. 82692da5-a86f-44c9-9d53-2f88d52b478b]" /><add key="ida:ClientSecret" value="[Enter client Secret as obtained from Azure Portal, e.g. a86f82692da5-a86f-9d53-2f88d52b478b]" /><add key="ida:Tenant" value="[Enter tenant name, e.g. crazyDeveloper2.onmicrosoft.com]" /><add key="ida:AADInstance" value="https://login.microsoftonline.com/{0}" /><add key="ida:PostLogoutRedirectUri" value="https://localhost:44369/" /><add key="ida:ServiceResourceID"  value="https://crazyDeveloper2.onmicrosoft.com/crazyDeveloper2_WebApplication" />
<!--address of the client application when we will register on azure-->
//The Client ID is used by the application to uniquely identify //itself to Azure AD.ClientID we will get after   registering this //application on Azure ADprivate static string clientId =  ConfigurationManager.AppSettings["ida:ClientId"];//The clientSecret is used by the   application to uniquely //identify itself to Azure AD.private static string clientSecret = ConfigurationManager.AppSettings["ida:ClientSecret"];//The AAD Instance is the instance of   Azure, for example public //Azure or Azure US.private static string addInstance = ConfigurationManager.AppSettings["ida:AADInstance"];private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];//The Post Logout Redirect Uri is the URL where the user will be //redirected after they sign out.private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];//ServerResourceID is the path where we have registered on azure AD.private static string serviceResourceID = ConfigurationManager.AppSettings["ida:ServiceResourceID"];// The Authority is the sign-in URL of the   tenant.string authority = String.Format(CultureInfo.InvariantCulture,   aadInstance, tenant);//ResourceBaseUrl could be anything (e.g. same web //application //resource or web api as well but for that we have   to again get //the access token and then pass for it )private static string ResourceBaseUrl = "https://localhost:44369/";

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store