You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/integration-dsp-no-sdk.md
+7-31Lines changed: 7 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ import Link from '@docusaurus/Link';
13
13
14
14
This document provides instructions for DSPs who want to integrate with UID2 but who are using a programming language not supported by an existing UID2 SDK.
15
15
16
-
For a list of the existing SDKs, see [SDKs: Summary](../sdks/summary-sdks.md).
16
+
For a list of all SDKs, see [SDKs: Summary](../sdks/summary-sdks.md).
17
17
18
18
## Overview
19
19
@@ -60,7 +60,6 @@ When you have current keys, you'll be able to decrypt a UID2 token into a raw UI
60
60
61
61
You'll need to complete the following steps:
62
62
63
-
1.[Check the token version](#check-the-token-version).
64
63
65
64
1.[Decrypt the token](#decrypt-the-token).
66
65
@@ -70,17 +69,9 @@ You'll need to complete the following steps:
70
69
71
70
The UID2 SDK for C# / .NET uses a `DecryptTokenIntoRawUid` function to perform these steps: see [BidstreamClient.cs, line 15](https://github.com/IABTechLab/uid2-client-net/blob/6ac53b106301e431a4aada3cbfbb93f8164ff7be/src/UID2.Client/BidstreamClient.cs#L15).
72
71
73
-
### Check the Token Version
74
-
75
-
There are different UID2 token versions in current use, and later processing steps are a little different depending on whether the token version is v2 or a later version.
76
-
77
-
You can check the token version using the first few bytes of the token.
78
-
79
-
To review detailed logic, see [UID2Encryption.cs, lines 36-50](https://github.com/IABTechLab/uid2-client-net/blob/6ac53b106301e431a4aada3cbfbb93f8164ff7be/src/UID2.Client/UID2Encryption.cs#L36-L50).
80
-
81
72
### Decrypt the Token
82
73
83
-
Use the master key and site key to decrypt the token. For a code example, refer to the `Decrypt` function: see [UID2Encryption.cs, line 29](https://github.com/IABTechLab/uid2-client-net/blob/6ac53b106301e431a4aada3cbfbb93f8164ff7be/src/UID2.Client/UID2Encryption.cs#L29). This function decrypts UID2 tokens into raw UID2s as part of the UID2 SDK for C# / .NET, and includes logic to handle different token versions.
74
+
Use the master key and site key to decrypt the token. For a code example, refer to the `Decrypt` function: see [UID2Encryption.cs, line 29](https://github.com/IABTechLab/uid2-client-net/blob/6ac53b106301e431a4aada3cbfbb93f8164ff7be/src/UID2.Client/UID2Encryption.cs#L29). This function decrypts UID2 tokens into raw UID2s as part of the UID2 SDK for C# / .NET.
84
75
85
76
<!--
86
77
### For Tokens Generated on the Client Side: Honor Opt-Out Status
@@ -102,7 +93,7 @@ For more information about client-side UID2 integration, refer to one of these i
102
93
103
94
### Make Sure Token Lifetime and Expiration Are Valid
104
95
105
-
A token must be valid and current so that it can be used in the bidstream. You must do two things:
96
+
For use in the bidstream, a token must be valid and current. You must do two things:
106
97
107
98
- Make sure that the token hasn't expired.
108
99
- Check that the token lifetime is a valid value.
@@ -116,32 +107,17 @@ To make sure that the token lifetime has a valid value, check these two conditio
116
107
117
108
For an example of how this is done, review the code for the `DoesTokenHaveValidLifetimeImpl` function: see [UID2Encryption.cs, line 237](https://github.com/IABTechLab/uid2-client-net/blob/6ac53b106301e431a4aada3cbfbb93f8164ff7be/src/UID2.Client/UID2Encryption.cs#L237).
118
109
119
-
The following sections show how the lifetime for a token is calculated, and the time until token generation for versions later than v2. The calculation depends on the token version:
-[Calculating Token Lifetime: All Later Versions](#calculating-token-lifetime-all-later-versions)
123
-
124
-
#### Calculating Token Lifetime: Token v2
125
-
126
-
For token v2, the calculation to make sure that the token lifetime is valid for bidstream use is as follows:
127
-
128
-
```
129
-
lifetime = token expiry - current time
130
-
```
131
-
132
-
For v2, we use the token expiry minus the current time to calculate the lifetime. This is because v2 doesn't have a **Token Generated** field, which is present in later versions. All token versions have an **Identity Established** field, but this indicates the time that the original token was generated, before any token refreshes, so it can't be used to calculate whether the token is still valid.
133
-
134
-
#### Calculating Token Lifetime: All Later Versions
110
+
#### Calculating Token Lifetime
135
111
136
-
For all token versions later than v2, the calculation to make sure that the token lifetime is valid for bidstream use is as follows:
112
+
The calculation to make sure that the token lifetime is valid for bidstream use is as follows:
137
113
138
114
```
139
115
lifetime = token expiry - token generated
140
116
141
117
time until token generation = token generated - current time
142
118
```
143
119
144
-
Versions later than v2 have a **Token Generated** field, which is updated if the token is refreshed, so we use this to calculate the token lifetime.
120
+
The token includes a **Token Generated** field, which is updated if the token is refreshed, so we use this to calculate the token lifetime.
145
121
146
122
### For Tokens Generated on the Client Side: Verify the Domain or App Name
147
123
@@ -157,6 +133,6 @@ For more information about client-side UID2 integration, refer to one of these i
157
133
158
134
## Honor User Opt-Out After Token Decryption
159
135
160
-
After decrypting the token, you must check the resulting raw UID2 against your opt-out records. If it appears on your opt-out records, you must honor the user's opt-out preference, including by not using the UID2 for bidding.
136
+
After decrypting the token, you must check the resulting raw UID2 against your opt-out records. If it appears in your opt-out records, you must honor the user's opt-out preference, including by not using the UID2 for bidding.
161
137
162
138
For more information, refer to [Honor User Opt-Outs](dsp-guide.md#honor-user-opt-outs) in the *DSP Integration Guide*.
0 commit comments