This repository has been archived by the owner on Dec 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
338a4c1
commit 7b26b46
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import json | ||
import requests | ||
|
||
oktaAPIToken = "" | ||
oktaGroup = "" | ||
oktaOrg = "" | ||
|
||
appUsers = [] | ||
with open('appUsers.txt', 'r') as appFile: | ||
for line in appFile: | ||
appUsers.append(line.strip().lower()) | ||
|
||
oktaUsers = [] | ||
r = requests.get("https://" + oktaOrg + ".okta.com/api/v1/groups/" + oktaGroup + "/users", headers={'Authorization': 'SSWS ' + oktaAPIToken}) | ||
oktaUsersJson = r.json() | ||
for user in oktaUsersJson: | ||
oktaUsers.append(user['profile']['login']) | ||
|
||
r = requests.get("https://" + oktaOrg + ".okta.com/api/v1/groups/" + oktaGroup2 + "/users", headers={'Authorization': 'SSWS ' + oktaAPIToken}) | ||
oktaUsersJson = r.json() | ||
for user in oktaUsersJson: | ||
oktaUsers.append(user['profile']['login']) | ||
|
||
inAppNotInOkta = set(appUsers) - set(oktaUsers) | ||
inOktaNotInApp = set(oktaUsers) - set(appUsers) | ||
|
||
print "These people are in App and not in Okta" | ||
for user in inAppNotInOkta: | ||
print user | ||
|
||
print "These people are in Okta and not in App" | ||
for user in inOktaNotInApp : | ||
print user |