Exemple #1
0
        public static List <App> ListApps(string Id)
        {
            var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/apps?filter=user.id+eq+\"{Id}\"", _oktaToken);

            //var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/apps?filter=user.id+eq+\"{Id}\"&expand=user/{Id}", _oktaToken);

            return(JsonConvert.DeserializeObject <List <App> >(sJsonResponse));
        }
        public static string GetUserIdByName(LoginViewModel model)
        {
            var     sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users?q={Uri.EscapeDataString(model.UserName)}", _oktaToken);
            dynamic dUsers        = JsonConvert.DeserializeObject(sJsonResponse);

            if (dUsers.Count == 0)
            {
                sJsonResponse = AddNewUser(model);
                var oCustomer = JsonConvert.DeserializeObject <Customer>(sJsonResponse);
                return(oCustomer.Id);
            }
            else if (dUsers.Count == 1)
            {
                var oUser = System.Linq.Enumerable.First(dUsers);
                return(oUser.id);
            }
            return(null);//more than 1 match, could add filter to improve this logic
        }
Exemple #3
0
        public static Customer GetCustomerById(string Id)
        {
            var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users/{Id}", _oktaToken);

            return(JsonConvert.DeserializeObject <Customer>(sJsonResponse));
        }
Exemple #4
0
        public static string GetAllCustomers()
        {
            var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users?limit=100", _oktaToken);

            return(sJsonResponse);
        }
Exemple #5
0
        public static IEnumerable <BaseCustomer> GetAllCustomers()
        {
            var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users?limit=100", _oktaToken);

            return(JsonConvert.DeserializeObject <IEnumerable <BaseCustomer> >(sJsonResponse));
        }
        public static dynamic ListUserFactors(string userid)
        {
            var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users/{userid}/factors", _oktaToken);

            return(JsonConvert.DeserializeObject(sJsonResponse));
        }