Exemple #1
0
        private static async Task IsAliveAsync(JordClient jordClient)
        {
            Console.WriteLine("Calling IsAlive");
            var result = await jordClient.IsAliveAsync();

            Console.WriteLine("IsAlive response: " + result);
        }
Exemple #2
0
        private static async Task GetClaimsAsync(JordClient jordClient)
        {
            Console.WriteLine("Calling GetClaims");
            var result = await jordClient.GetClaimsAsync();

            Console.WriteLine("GetClaims response: ");
            foreach (var claim in result)
            {
                Console.WriteLine(claim);
            }
        }
Exemple #3
0
        public static async Task <JordClient> CreateAsync(string apiUrl)
        {
            var oidcClient = InitializeLoginClient();

            Console.WriteLine("Logging in");
            var loginResult = await Login(oidcClient);

            // Request a new access token using the refresh token if it is expired.
            //var refreshResult = await oidcClient.RefreshTokenAsync(loginResult.RefreshToken);
            //Console.WriteLine(refreshResult.IdentityToken);

            var httpClient = new HttpClient();

            httpClient.SetBearerToken(loginResult.AccessToken);

            Console.WriteLine("Initializing Jord client");
            var jordClient = new JordClient(apiUrl, httpClient);

            return(jordClient);
        }