

The StrongDM client checks the local environment for the variable SDM_ADMIN_TOKEN.

Paste the service account token and click continue.That causes the prompt to change from email to service account token. Select the desktop app’s sdm icon from the menu bar on your screen.Pass the service account token to the CLI login command. Service Accounts on macOS and Linux # Use the CLI #
#Duo admin api powershell how to
The rest of this guide covers how to authenticate with a service account on macOS, Linux, and Windows. Check the Admin UI Guide to see how to create service accounts. This is useful for continuous-integration pipelines, extract-transform-load jobs, or any automated function that would need resource access. Sample Output: The script will ask for the username first, then will extract the latest data for this user from Duo.Service accounts allow for programmatic access to StrongDM resources. Print(Fore.WHITE + 'Last Login: '+ Fore.CYAN +datetime.utcfromtimestamp(log).strftime('%Y-%m-%d %H:%M:%S')) If not log: print(Fore.RED + "*** No Group Membership Found ***") Print(Fore.WHITE + 'ID: '+ Fore.CYAN + phone) Print(Fore.WHITE + 'Phone Number: '+ Fore.CYAN + phone) Print(Fore.WHITE + 'Phone Model: '+ Fore.CYAN + phone) Print(Fore.WHITE + 'Phone OS: '+ Fore.CYAN + phone) Print(Fore.WHITE + 'Last Directory Sync (UTC): '+ Fore.CYAN +datetime.utcfromtimestamp(log).strftime('%Y-%m-%d %H:%M:%S')) Print(Fore.WHITE + 'Date Created (UTC): '+ Fore.CYAN +datetime.utcfromtimestamp(log).strftime('%Y-%m-%d %H:%M:%S'))

Print(Fore.WHITE + 'Alias 4: '+ Fore.CYAN + str(log)) Print(Fore.WHITE + 'Alias 3: '+ Fore.CYAN + str(log)) Print(Fore.WHITE + 'Alias 2: '+ Fore.CYAN + str(log)) Print(Fore.WHITE + 'Alias 1: '+ Fore.CYAN + str(log)) Print(Fore.WHITE + 'Enrolled: '+ Fore.CYAN + str(log)) Print(Fore.RED + "* If user is still active, please check why user is disabled in AD.") Print(Fore.WHITE + 'Status: '+ Fore.RED + log) If(log = "active" or log = "Active"): print(Fore.WHITE + 'Status: '+ Fore.CYAN + log) Print(Fore.WHITE + 'Email Address: '+ Fore.CYAN + log) Print(Fore.WHITE + 'User ID: '+ Fore.CYAN + log) Print(Fore.WHITE + 'FullName: ' + Fore.CYAN + log) Print(Fore.WHITE + 'Result: ' + Fore.CYAN + 'User Synced Successfully!!!') Print(Fore.WHITE + "*** You are providing incorrect username")Īdmin_api.sync_user(username = username + domain,directory_key =' YOUR_DIRECTORY_KEY',) Print(Fore.WHITE + "*** User is not yet synced in AD/Azure") Print(Fore.WHITE + "*** SSO Account is not yet created") Print(Fore.WHITE + "* Possible Reasons:") Print(Fore.WHITE + 'Result: ' + Fore.RED + "User not found in Duo!!!") Logs = admin_api.get_users_by_name(username = username) Print(Fore.WHITE + "Current Time: " + current_time) Print(Fore.WHITE + "Sync Individual User from Azure to Duo") The Directory Key which will be coming from Duo Admin ConsoleĪdmin_api = duo_client.Admin(ikey=DUO_IKEY, skey=DUO_SKEY, host=DUO_APIHOSTNAME)Ĭurrent_time = (sa_time.strftime('%Y-%m-%d %H:%M:%S') + " " + str(tz_PST)).Check this article if you need help in how to obtain the integration keys: My Duo Keys for Admin API using Python. The file my_duo_keys is where you have your Duo Admin API credentials.Assuming you have already installed the Duo Admin API.This is a Python script for syncing individual Duo user into your Directory
