The HAP 5.1 authorization code in libraries like hap-python is stored in the config.json file:
Implementing the HAP 5.1 Authorization Code effectively requires careful planning and adherence to best practices: hap 5.1 authorization code