diff options
| author | Glenn Smith <glenn@vector35.com> | 2021-12-08 18:31:44 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2021-12-08 20:03:52 -0500 |
| commit | 41eb3f398612a864f045d3e19c5df0ae397c8d80 (patch) | |
| tree | ca8e959b364f2a45c93257b98bd458b062bc67d7 /python/__init__.py | |
| parent | 273b30abc8782767d4d94938dcda61b87e8efc83 (diff) | |
[Enterprise] API for getting the current session token
Diffstat (limited to 'python/__init__.py')
| -rw-r--r-- | python/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/python/__init__.py b/python/__init__.py index 12cb7033..c1af70d4 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -129,7 +129,12 @@ def _init_plugins(): if not core_ui_enabled() and core.BNGetProduct() == "Binary Ninja Enterprise Client": # Enterprise client needs to checkout a license reservation or else BNInitPlugins will fail - if not enterprise.authenticate_with_method("Keychain") and (not core.BNIsLicenseValidated() or not enterprise.is_license_still_activated()): + if not enterprise.is_license_still_activated(): + try: + enterprise.authenticate_with_method("Keychain") + except RuntimeError: + pass + if not core.BNIsLicenseValidated() or not enterprise.is_license_still_activated(): raise RuntimeError( "To use Binary Ninja Enterprise from a headless python script, you must check out a license first.\n" "You can either check out a license for an extended time with the UI, or use the binaryninja.enterprise module.") |
