summaryrefslogtreecommitdiff
path: root/python/enterprise.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-12-08 18:31:44 -0500
committerGlenn Smith <glenn@vector35.com>2021-12-08 20:03:52 -0500
commit41eb3f398612a864f045d3e19c5df0ae397c8d80 (patch)
treeca8e959b364f2a45c93257b98bd458b062bc67d7 /python/enterprise.py
parent273b30abc8782767d4d94938dcda61b87e8efc83 (diff)
[Enterprise] API for getting the current session token
Diffstat (limited to 'python/enterprise.py')
-rw-r--r--python/enterprise.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/enterprise.py b/python/enterprise.py
index b94fd7ca..1d9743a1 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -99,6 +99,17 @@ def username() -> Optional[str]:
return value
+def token() -> Optional[str]:
+ """
+ Get the token of the currently authenticated user to the Enterprise Server.
+ :return: Token, if authenticated. None, otherwise.
+ """
+ value = core.BNGetEnterpriseServerToken()
+ if value == "":
+ return None
+ return value
+
+
def server_name() -> Optional[str]:
"""
Get the display name of the currently connected server