Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/getting-started/gs-normalization-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ If the input data doesn't have a valid email or phone number format, or if the p

You can use this tool to verify that your internal processes are set up to correctly create normalized, hashed, and encoded values for UID2.

## UID2 Token Validator

:::note
This section is for publishers only. Publishers are the only participants who should generate [UID2 tokens](../ref-info/glossary-uid.md#gl-uid2-token) using directly identifying information (DII).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest remove "should" here. Publishers are the only participants who can and do, I think. "should" implies it's possible for other participants to do so, which is hopefully not true.

Suggested change
This section is for publishers only. Publishers are the only participants who should generate [UID2 tokens](../ref-info/glossary-uid.md#gl-uid2-token) using directly identifying information (DII).
This section is for publishers only. Publishers are the only participants who generate [UID2 tokens](../ref-info/glossary-uid.md#gl-uid2-token) using directly identifying information (DII).

:::

To validate the full token generation pipeline end-to-end, confirming that <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> generated from your normalized, hashed and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here except two small things:

  1. end to end is not a modifier here, so use separate words, no hyphens:

"to validate ... end to end"

When used as a modifier it would be correct: for example, "end-to-end workflow"

  1. serial comma after hashed -- normal in the US.
Suggested change
To validate the full token generation pipeline end-to-end, confirming that <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> generated from your normalized, hashed and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).
To validate the full token generation pipeline end to end, confirming that <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> generated from your normalized, hashed, and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).


## Troubleshooting

In all scenarios, follow the steps on your side to prepare your DII for processing, and then check your resulting values by using the [UID2 hashing tool](https://hashing-tool.samples.uidapi.com/). If the results don't match, check each step to find the error.
Expand Down
81 changes: 81 additions & 0 deletions docs/ref-info/ref-token-validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: UID2 Token Validator
description: How to use the UID2 Token Validator to validate UID2 tokens against source DII and confirm your token generation workflow is correct.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest add "that":

"and confirm that your..."

Tiny bit clearer

hide_table_of_contents: false
sidebar_position: 02
displayed_sidebar: docs
---

import Link from '@docusaurus/Link';

# UID2 Token Validator

The [UID2 Token Validator](https://token-validator.uidapi.com/) is a web-based tool that validates <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> against their source <Link href="../ref-info/glossary-uid#gl-dii">directly identifying information (DII)</Link> to confirm that token generation is working correctly.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to confirm that token generation is working correctly." sounds as though we're checking to make sure things are functioning correctly on our side. In fact, we're checking that they are doing their steps correctly (I think).

Suggest:

Suggested change
The [UID2 Token Validator](https://token-validator.uidapi.com/) is a web-based tool that validates <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> against their source <Link href="../ref-info/glossary-uid#gl-dii">directly identifying information (DII)</Link> to confirm that token generation is working correctly.
The [UID2 Token Validator](https://token-validator.uidapi.com/) is a web-based tool that validates <Link href="../ref-info/glossary-uid#gl-uid2-token">UID2 tokens</Link> against their source <Link href="../ref-info/glossary-uid#gl-dii">directly identifying information (DII)</Link> to confirm that your token generation process is correct.

(second person, "you", is good, as you've used later -- more direct.)


## Overview

Publishers who generate UID2 tokens by providing DII sometimes receive tokens that appear valid but are unusable in the UID2 ecosystem. This happens when the normalization or hashing steps are not performed correctly. Because UID2 uses the normalized and hashed form of DII to derive the token, an error in either step produces a token that is unique to the publisher and will not match tokens generated by other publishers, data providers, or advertisers' CRM uploads.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical question here. I thought that a publisher token IS unique to the publisher, and does not, must not, match tokens generated by other publishers. I believe it is. I could well be wrong. Would appreciate to check. I might be getting mixed up with Sharing functionality.

I think what we are trying to say is simply that if there is an error in the earlier steps, the result is not a valid UID2 token.


## Prerequisites

To use the UID2 Token Validator, you need:

- A **UID2 API Key** (Client Key)
- A **UID2 Client Secret**

If you do not have these, see [API Keys](../portal/api-keys.md) for instructions on creating them in the UID2 Portal.

## Using the Token Validator

Enter your **API Key** (Client Key) and **Client Secret** in the fields at the top of the Token Validation section.

Select the **Operator** (environment) you want to validate against. For information about UID2 environments, see [Environments](../getting-started/gs-environments.md).

### Validate a Single Token

1. Under **Input Mode**, select **Single Validation**.
2. In the **Identifier** field, enter the DII you used to generate the token. This can be:
- A raw email address
- A raw phone number
- A Base64-encoded email hash
- A Base64-encoded phone hash
3. Select the **Identifier Type** that matches your input.
4. In the **Token** field, paste the UID2 token you want to validate.
5. Click **Validate Tokens**.

### Validate Multiple Tokens (CSV)

To validate a batch of token-identifier pairs:

1. Under **Input Mode**, select **CSV**.
2. Prepare a CSV file with the following columns:
- `identifier`: The DII (raw email, raw phone, email hash, or phone hash)
- `identifier_type`: Either `email`, `phone`, `email_hash` or `phone_hash`
- `token`: The UID2 token to validate.
3. Upload the CSV file.
4. Click **Validate Tokens**.

## Interpreting Validation Results

After clicking **Validate Tokens**, the **Validation Results** table displays a row for each token-identifier pair:

| Column | Description |
|---|---|
| Identifier | The DII you entered |
| Identifier Type | `email`, `phone`, `email_hash` or `phone_hash` |
| Normalized Hash | The Base64-encoded SHA-256 hash of the normalized DII |
| Token | The token you submitted |
| Validation | The result of the validation, see the table below |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. In the table, include full stops at the end of the descriptions. They are complete sentences.

  2. Tech writing guidance is not to use above and below, for accessibility reasons. Can you link to it instead? Actually I guess not. Suggest:

Suggested change
| Validation | The result of the validation, see the table below |
| Validation | The result of the validation. For details, see the following table. |


The **Validation** column reflects the response from the [POST&nbsp;/token/validate](../endpoints/post-token-validate.md) endpoint.

| Validation Result | Meaning |
|---|---|
| `Token matches identifier` | The token matches the provided DII, the token was generated from the correct normalized hash |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two sentences, with periods.

Suggested change
| `Token matches identifier` | The token matches the provided DII, the token was generated from the correct normalized hash |
| `Token matches identifier` | The token matches the provided DII. This means that the token was generated from the correct normalized hash. |

| `Failed: Token does not match identifier` | The token does not match the provided DII, the most likely cause is incorrect normalization or hashing |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two sentences.

Suggested change
| `Failed: Token does not match identifier` | The token does not match the provided DII, the most likely cause is incorrect normalization or hashing |
| `Failed: Token does not match identifier` | The token does not match the provided DII. The most likely cause is incorrect normalization or hashing. |

| `Failed: Invalid token` | The token is malformed and cannot be parsed |
| `Failed: {"status":"unauthorized"}` | The API credentials provided are invalid or unauthorized |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again here, periods for the descriptions. They are complete sentences.


:::tip
If the result is **Failed: Token does not match identifier**, compare the **Normalized Hash** shown in the results with what your own implementation produces for the same DII. If they differ, the issue is in your normalization or hashing steps. See [Normalization and Encoding](../getting-started/gs-normalization-encoding.md) and [Preparing Emails and Phone Numbers for Processing](ref-preparing-emails-and-phone-numbers-for-processing.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

produces > produced

:::
4 changes: 3 additions & 1 deletion docs/snippets/_snpt-preparing-emails-and-phone-numbers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ import Link from '@docusaurus/Link';

It's critical that the input data, which you are converting to UID2, is in an acceptable format. If it isn't, you won't get the expected results. For example, you must normalize phone numbers to include the country code, as explained in [Phone Number Normalization](../getting-started/gs-normalization-encoding.md#phone-number-normalization).

For details, see [Preparing Emails and Phone Numbers for Processing](../ref-info/ref-preparing-emails-and-phone-numbers-for-processing.md).
For details, see [Preparing Emails and Phone Numbers for Processing](../ref-info/ref-preparing-emails-and-phone-numbers-for-processing.md).

To validate the full token generation pipeline end-to-end, confirming that tokens generated from your normalized, hashed and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things here. End-to-end shoudl not be hyphenated, and add a comma after hashed (American usually does use this comma):

Suggested change
To validate the full token generation pipeline end-to-end, confirming that tokens generated from your normalized, hashed and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).
To validate the full token generation pipeline end to end, confirming that tokens generated from your normalized, hashed, and encoded values are correct, use the [UID2 Token Validator](../ref-info/ref-token-validator.md).

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ const fullSidebar = [
'getting-started/gs-encryption-decryption',
'getting-started/gs-normalization-encoding',
'ref-info/ref-preparing-emails-and-phone-numbers-for-processing',
'ref-info/ref-token-validator',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need additional entries in sidebars.js to exclude it from the sidebar for the other personas.
Sending proposed revised sidebar via Slack.

'getting-started/gs-opt-out',
'ref-info/ref-operators-public-private',
'ref-info/ref-integration-approaches',
Expand Down
Loading