-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #695 from IABTechLab/jpn-translation-update-661-689
Jpn translation update 661 689
- Loading branch information
Showing
59 changed files
with
767 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,20 @@ UID2 API のリクエストレスポンスワークフローは、以下のス | |
|
||
例えば、先行例 のメールアドレスに対する [POST /token/generate](../endpoints/post-token-generate.md) リクエストに対する復号されたレスポンスは、次のようになります: | ||
|
||
<IdentityGenerateResponse /> | ||
```json | ||
{ | ||
"body": { | ||
"advertising_token": "AgAAAQFt3aNLXKXEyWS8Tpezcymk1Acv3n+ClOHLdAgqR0kt0Y+pQWSOVaW0tsKZI4FOv9K/rZH9+c4lpm2DBpmFJqjdF6FAaAzva5vxDIX/67UOspsYtiwxH73zU7Fj8PhVf1JcpsxUHRHzuk3vHF+ODrM13A8NAVlO1p0Wkb+cccIIhQ==", | ||
"user_token": "AgAAAPpTqz7/Z+40Ue5G3XOM2RiyU6RS9Q5yj1n7Tlg7PN1K1LZWejvo8Er7A+Q8KxdXdj0OrKRf/XEGWsyUJscRNu1bg/MK+5AozvoJKUca8b10eQdYU86ZOHPH7pFnFhD5WHs=", | ||
"refresh_token": "AAAAAQLMcnV+YE6/xoPDZBJvJtWyPyhF9QTV4242kFdT+DE/OfKsQ3IEkgCqD5jmP9HuR4O3PNSVnCnzYq2BiDDz8SLsKOo6wZsoMIn95jVWBaA6oLq7uUGY5/g9SUOfFmX5uDXUvO0w2UCKi+j9OQhlMfxTsyUQUzC1VQOx6ed/gZjqH/Sw6Kyk0XH7AlziqSyyXA438JHqyJphGVwsPl2LGCH1K2MPxkLmyzMZ2ghTzrr0IgIOXPsL4lXqSPkl/UJqnO3iqbihd66eLeYNmyd1Xblr3DwYnwWdAUXEufLoJbbxifGYc+fPF+8DpykpyL9neq3oquxQWpyHsftnwYaZT5EBZHQJqAttHUZ4yQ==", | ||
"identity_expires": 1654623500142, | ||
"refresh_expires": 1657214600142, | ||
"refresh_from": 1654622900142, | ||
"refresh_response_key": "wR5t6HKMfJ2r4J7fEGX9Gw==" | ||
}, | ||
"status": "success" | ||
} | ||
``` | ||
|
||
## Encryption and Decryption Code Examples | ||
|
||
|
@@ -155,7 +168,7 @@ Maven を使用している場合は、以下の最小限の `pom.xml` を使用 | |
<groupId>org.example</groupId> | ||
<artifactId>Uid2Request</artifactId> | ||
<version>1.0</version> | ||
|
||
<properties> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
|
@@ -194,7 +207,7 @@ Maven を使用している場合は、以下の最小限の `pom.xml` を使用 | |
</configuration> | ||
</plugin> | ||
</plugins> | ||
<finalName>${artifactId}</finalName> | ||
<finalName>${artifactId}</finalName> | ||
</build> | ||
</project> | ||
``` | ||
|
@@ -223,7 +236,7 @@ Usage: | |
Example: | ||
echo '{"email": "[email protected]"}' | python3 uid2_request.py https://prod.uidapi.com/v2/token/generate PRODGwJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg= wJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg= | ||
Refresh Token Usage: | ||
python3 uid2_request.py <url> --refresh-token <refresh_token> <refresh_response_key> | ||
|
@@ -286,7 +299,7 @@ else: | |
envelope += bytearray(tag) | ||
|
||
base64Envelope = base64.b64encode(bytes(envelope)).decode() | ||
|
||
http_response = requests.post(url, base64Envelope, headers={"Authorization": "Bearer " + api_key}) | ||
|
||
# Decryption | ||
|
@@ -299,7 +312,7 @@ else: | |
iv = resp_bytes[:12] | ||
data = resp_bytes[12:len(resp_bytes) - 16] | ||
tag = resp_bytes[len(resp_bytes) - 16:] | ||
|
||
cipher = AES.new(secret, AES.MODE_GCM, nonce=iv) | ||
decrypted = cipher.decrypt_and_verify(data, tag) | ||
|
||
|
@@ -349,13 +362,13 @@ public class Uid2Request { | |
System.out.println( | ||
"Usage:" + "\n " | ||
+ "java -jar Uid2Request-jar-with-dependencies.jar <url> <api_key> <client_secret>" + "\n\n" | ||
|
||
+ "Example:" + "\n " | ||
+ "echo '{\"email\": \"[email protected]\"}' | java -jar Uid2Request-jar-with-dependencies.jar https://prod.uidapi.com/v2/token/generate PRODGwJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg= wJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg=" + "\n\n\n" | ||
|
||
+ "Refresh Token Usage:" + "\n " | ||
+ "java -jar Uid2Request-jar-with-dependencies.jar <url> --refresh-token <refresh_token> <refresh_response_key>" + "\n\n" | ||
|
||
+ "Refresh Token Example:" + "\n " | ||
+ "java -jar Uid2Request-jar-with-dependencies.jar https://prod.uidapi.com/v2/token/refresh --refresh-token AAAAAxxJ...(truncated, total 388 chars) v2ixfQv8eaYNBpDsk5ktJ1yT4445eT47iKC66YJfb1s=" + "\n" | ||
); | ||
|
@@ -463,7 +476,7 @@ Usage: | |
Example: | ||
echo '{"email": "[email protected]"}' | .\uid2_request https://prod.uidapi.com/v2/token/generate UID2-C-L-999-fCXrMM.fsR3mDqAXELtWWMS+xG1s7RdgRTMqdOH2qaAo= wJ0hP19QU4hmpB64Y3fV2dAed8t/mupw3sjN5jNRFzg= | ||
Refresh Token Usage: | ||
.\uid2_request <url> --refresh-token <refresh_token> <refresh_response_key> | ||
|
@@ -571,7 +584,7 @@ else | |
var json = Encoding.UTF8.GetString(unencryptedResponseDataEnvelope, offset, unencryptedResponseDataEnvelope.Length - offset); | ||
|
||
Console.WriteLine("Response JSON:"); | ||
|
||
using var jDoc = JsonDocument.Parse(json); | ||
Console.WriteLine(JsonSerializer.Serialize(jDoc, new JsonSerializerOptions { WriteIndented = true })); | ||
} | ||
|
Oops, something went wrong.