# ---------------------------------------------------------------------------# from dracoon import core, nodes import sys import getpass # replace with client id from OAuth app - for Cloud you can use dracoon_legacy_scripting if enabled in apps clientID = 'xxxx' # replace with client secret - dracoon_legacy_scripting has no secret, it can be omitted as parameter clientSecret = 'xxxxxx' baseURL = 'https://dracoon.team' # replace with own DRACOON url # create object to authenticate and send requests - client secret is optional (e.g. for use with dracoon_legacy_scripting) my_dracoon = core.Dracoon(clientID) my_dracoon.set_URLs(baseURL) # get user login credentials (basic, AD possible) RO_user = input('Username: '******'Password: '******'Login successful: ' + str(login_response.status_code)) else:
# Requires dracoon package # Author: Octavio Simone, 12.06.2021 # ---------------------------------------------------------------------------# from dracoon import core, nodes, crypto, user, uploads import getpass import os # base settings client_id = 'xxxx' client_secret = 'xxxx' base_url = 'https://dracoon.team' # initialize dracoon dracoon = core.Dracoon(clientID=client_id, clientSecret=client_secret) dracoon.set_URLs(baseURL=base_url) # authenticate print(dracoon.get_code_url()) auth_code = input('Enter auth code:') dracoon.oauth_code_auth(code=auth_code) # get user keypair r = user.get_user_keypair() print(r) try: keypair_response = dracoon.get(r)
# Author: Octavio Simone, 28.04.2021 # ---------------------------------------------------------------------------# from dracoon import core, users, nodes import sys import getpass from datetime import datetime # replace with client id from OAuth app - for Cloud you can use dracoon_legacy_scripting if enabled in apps clientID = 'xxxx' # replace with client secret - dracoon_legacy_scripting has no secret, it can be omitted as parameter clientSecret = 'xxxxxx' baseURL = 'https://dracoon.team' # replace with own DRACOON url # create DRACOON object my_dracoon = core.Dracoon(clientID, clientSecret) my_dracoon.set_URLs(baseURL) # get user login credentials (basic, AD possible) RO_user = input('Username: '******'Password: '******'Login successful: ' + str(login_response.status_code))