Last active
July 6, 2021 15:47
-
-
Save phi1ipp/56f644dfa995bff63ecb2e4913515b3d to your computer and use it in GitHub Desktop.
How to grab data about Okta groups from Okta Admin console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loop(i) { | |
setTimeout(() => { | |
fetch('https://' + domain + '/admin/groups/search?iColumns=8&sColumns=id%2Cname%2CappName%2CappDisplayName%2Cdescription%2CuserCount%2CappCount%2CdirCount&orderBy=name&sortDirection=asc&maxResults=100&iDisplayStart=' + i + '&sSearch=') | |
.then(resp => resp.text()) | |
.then(data => { | |
var json = JSON.parse(data.substring(11)); // 11 is a number of first symbols to remove from the result, | |
// as it's always "while(1){};" | |
console.log(json.aaData); // just for visual progress tracking | |
aaData = aaData.concat(json.aaData); | |
if (i < upper) | |
loop(i + 100) | |
}) | |
}, timeout) | |
} | |
var domain = 'you_domain.okta.com'; | |
var timeout = 10000; | |
var upper = 20000; | |
var i = 0; | |
var aaData = []; | |
loop(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment