assertion obtained from IDP and sent on to AAD /token endpoint


 

image

using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                AuthenticationContext ac = new AuthenticationContext("https://login.windows.net/rapmlsqa.com", false, null);
                var y = getitsync(ac);
                while (true) ;
            }
            catch (Exception ex)
            {
                ;
            }
 
        }

        async static Task<AuthenticationResult> getitsync(AuthenticationContext ac)
        {
            var y = await getit(ac);
            return y;
        }
        static async Task<AuthenticationResult> getit(AuthenticationContext ac)
        {
            AuthenticationResult x = await ac.AcquireTokenAsync("https://rapmlsqa.com/TodoListService", "a6e4ee63-87f3-45af-a5db-05099ab9f001", new UserCredential("andy@rapmlsqa.com", "1234"));
            return x;
        }
    }
}

console application, build against the ADAL dot net latest library from nuget

Advertisements

About home_pw@msn.com

Computer Programmer who often does network administration with focus on security servers. Very strong in Microsoft Azure cloud!
This entry was posted in AAD. Bookmark the permalink.