예제 #1
0
        static void Main(string[] args)
        {
            //string expectedSubscriptionID = "{b44fdde2-1234-1234-a75b-24429617b2d9}";
            AzureServicePrincipal sp    = new AzureServicePrincipal();
            AuthenticationResult  token = null;

            sp.subscriptionID    = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
            sp.tenantID          = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
            sp.applicationID     = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
            sp.applicationSecret = "xxxxxxxxxxxxxxxx";



            if (sp.CheckAllGuidsMembers() == true)
            {
                token = sp.GetSecurityToken();
                Console.WriteLine("Token acquired. Expires on:" + token.ExpiresOn);
            }
            else
            {
                Console.WriteLine("To run this test, please enter values for the service principal object in program.cs.");
            }
            Console.Write("Press a key to continue....");
            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            //string expectedSubscriptionID = "{b44fdde2-1234-1234-a75b-24429617b2d9}";
            AzureServicePrincipal sp    = new AzureServicePrincipal();
            AuthenticationResult  token = null;

            sp.subscriptionID    = "bc763005-d3e0-4e3f-b57b-c95bd0f9dc23";
            sp.tenantID          = "2d38b813-8ed2-4b98-9d2b-ca8c3a732b8e";
            sp.applicationID     = "570aa489-9df3-475f-8065-bc8fde0267df";
            sp.applicationSecret = "myAprilTestPassword89!";

            if (sp.CheckAllGuidsMembers() == true)
            {
                token = sp.GetSecurityToken();
                Console.WriteLine("Token acquired. Expires on:" + token.ExpiresOn);
            }

            Console.ReadLine();
        }