Skip to content

Commit c028b85

Browse files
authored
Sharing - readme changes (#19)
1 parent 419bf5b commit c028b85

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The UID 2 Project is subject to Tech Lab IPR’s Policy and is managed by the IAB Tech Lab Addressability Working Group and Privacy & Rearc Commit Group. Please review the governance rules [here](https://github.com/IABTechLab/uid2-core/blob/master/Software%20Development%20and%20Release%20Procedures.md).
44

55
## Who is this SDK for?
6-
This SDK simplifies integration with UID2 for Publishers and DSPs, as described in the [UID2 Integration Guides](https://github.com/UnifiedID2/uid2docs/blob/main/api/v2/guides/README.md).
6+
This SDK simplifies integration with UID2 for Publishers, DSPs, and UID Sharers, as described in the [UID2 Integration Guides](https://github.com/IABTechLab/uid2docs/blob/main/api/v2/guides/summary-guides.md).
77

88
## Requirements
99

@@ -19,7 +19,7 @@ Add this dependency to your project's POM:
1919
<dependency>
2020
<groupId>com.uid2</groupId>
2121
<artifactId>uid2-client</artifactId>
22-
<version>4.0.0</version>
22+
<version>4.1.2</version>
2323
</dependency>
2424
```
2525

@@ -120,3 +120,26 @@ If you're using [server-only integration](https://github.com/UnifiedID2/uid2docs
120120

121121
`TokenRefreshResponse tokenRefreshResponse = PublisherUid2Helper.createTokenRefreshResponse({response body}, identity);`
122122
6. You should then store `tokenRefreshResponse.getIdentityJsonString()` in the user's session. If the user has opted out, this method will return null, indicating that the user's identity should be removed from their session. (Optout can be confirmed via `tokenRefreshResponse.isOptout()`.)
123+
124+
## Usage for UID Sharers
125+
126+
A UID Sharer is a participant that wants to share UID2s or EUIDs with another participant. Raw UIDs must be encrypted into UID tokens before sending them to another participant. See com.uid2.client.test.IntegrationExamples (runSharingExample method) for an example usage.
127+
128+
1. Use UID2ClientFactory.create() to create an IUID2Client reference.
129+
130+
`private final IUID2Client client = UID2ClientFactory.create(UID2_BASE_URL, UID2_API_KEY, UID2_SECRET_KEY);`
131+
2. Call IUID2Client.refresh: once at startup, and then periodically (eg every hour):
132+
`client.refresh();`
133+
3. Senders call:
134+
1. `EncryptionDataResponse encrypted = client.encrypt(rawUid);`
135+
2. If encryption succeeded, send the UID token to the receiver:
136+
137+
`if (encrypted.isSuccess()) {` send `encrypted.getEncryptedData()` to receiver`} else {`check `encrypted.getStatus()` for the failure reason}
138+
4. Receivers call:
139+
1. `DecryptionResponse decrypted = client.decrypt(uidToken);`
140+
2. If decryption succeeded, use the raw UID:
141+
142+
`if (decrypted.isSuccess()) {`use `decrypted.getUid() } else {`check `decrypted.getStatus()` for the failure reason `}`
143+
144+
145+

0 commit comments

Comments
 (0)