---
# System prepended metadata

title: 二次驗證Python_Hash_Code & 串接API
tags: [Advanced Authentication]

---

# 二次驗證Python_Hash_Code & 串接API

## 二次驗證Python_Hash_Code

```
 salt="i_am_salt"
 endpoint_id="{endpoint_id}"
 endpoint_secret="{endpoint_secret}"
 import hashlib
 import os
 from hashlib import sha256
 salted_endpoint_id = (endpoint_id + salt).encode('utf-8')
 endpoint_id_hash = sha256(salted_endpoint_id).hexdigest()
 salted_enpoint_secret = (endpoint_secret + endpoint_id_hash).encode('utf-8')
 aa=sha256(salted_enpoint_secret).hexdigest()
 print(aa)

{endpoint_id_hex}{endpoint_secret_hex}
```


## 串接API

創立session 
https://aa.colorlife.com.tw/api/v1/endpoints/{endpoint_id}/sessions

登錄
https://aa.colorlife.com.tw/api/v1/logon

手機驗證
https://aa.colorlife.com.tw/api/v1/logon/{logon_process_id}/do_logon



###### tags: `Advanced Authentication`
