Encode JWT
This commit is contained in:
@@ -43,6 +43,10 @@ if not os.path.isfile(args.dev_priv_key_path):
|
||||
with open(args.dev_priv_key_path, "w") as f:
|
||||
f.write(key)
|
||||
|
||||
with open(args.dev_priv_key_path, "r") as f:
|
||||
args.priv_key = f.read()
|
||||
|
||||
|
||||
print("Check CSR")
|
||||
if not os.path.isfile(args.dev_csr_path):
|
||||
print("Generate CSR...")
|
||||
@@ -63,8 +67,7 @@ if status != "Validated":
|
||||
if status == "Unknown":
|
||||
print("Device is unknown on the system, need to submit a CSR...")
|
||||
with open(args.dev_csr_path, "r") as f:
|
||||
csr = "".join(f.read())
|
||||
|
||||
csr = "".utils
|
||||
print("Enrolling device...")
|
||||
api.enroll_device(csr)
|
||||
print("Done. Please accept the device on central system web UI")
|
||||
@@ -85,4 +88,6 @@ if not os.path.isfile(args.dev_crt_path):
|
||||
with open(args.dev_crt_path, "w") as f:
|
||||
f.write(cert)
|
||||
|
||||
|
||||
print("Done. ready to operate.")
|
||||
api.sync_device(args.dev_id, args.priv_key)
|
||||
|
||||
Reference in New Issue
Block a user