Skip to content

Commit e6d674d

Browse files
Decorate the aud not satisfied error with a message to prompt integra… (#201)
* Decorate the aud not satisfied error with a message to prompt integrators to double-check they've whitelisted their auth credentials - this issue comes up often * increment package version
1 parent efca84a commit e6d674d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/HttpClient.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ public async Task<T2> SendRequest<T, T2>(string path, T args, [CanBeNull] Dictio
219219
throw new Exception(exceptionMessage);
220220
}
221221
}
222+
else if (errorReason.Contains("JWT validation: aud not satisfied"))
223+
{
224+
exceptionMessage = "File load exception: " + e.Message + " response: " + errorReason +
225+
" Please make sure you've whitelisted the associated login method and associated configuration values in your Embedded Wallet configuration in the Sequence Builder!"
226+
+ "\nCurl-equivalent request: " + curlRequest;
227+
}
222228
throw new Exception(exceptionMessage);
223229
}
224230
catch (Exception e)
@@ -236,7 +242,7 @@ private string GetRequestErrorIfAvailable(UnityWebRequest request)
236242
{
237243
if (request.downloadHandler != null && request.downloadHandler.data != null)
238244
{
239-
return " response: " + Encoding.UTF8.GetString(request.downloadHandler.data);
245+
return " " + Encoding.UTF8.GetString(request.downloadHandler.data);
240246
}
241247

242248
return "";

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "3.12.0",
3+
"version": "3.12.1",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for the Sequence WaaS API",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)