How to Associate a Connection ID with Your End-User
Blog post from Unified.to
To associate connection IDs with end-users in applications using Unified.to, two methods are suggested: using the state parameter and using the external ID parameter. The recommended approach is the state parameter, which involves passing a secure, encoded state object containing user information through the OAuth 2.0 flow between the authorization request and callback. This object should include user IDs and optional security measures like a nonce, timestamp, and signature for verification, ensuring a consistent and secure connection association. Alternatively, the external ID method uses Unified.to's built-in uid field, embedding the user's ID directly into the authorization URL, which is then stored in the connection object for later querying. Best practices include validating state parameters, checking signatures, preventing nonce reuse, securely storing connections, using databases for mapping, encrypting sensitive data, and handling potential errors or missing parameters during the process.