public async Task <IActionResult> Index()
        {
            var tokenResponse = await ClientCredentials.GetAccessToken();

            var claims = await ClientCredentials.CallApi(tokenResponse.AccessToken);

            return(View(claims));
        }
Example #2
0
        static async Task Main(string[] args)
        {
            try
            {
                var tokenResponse = await ClientCredentials.GetAccessToken();

                Console.WriteLine(tokenResponse.Json);
                var claims = await ClientCredentials.CallApi(tokenResponse.AccessToken);

                Console.WriteLine(claims);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }