Summary:
I am implementing a migration to a backend infrastructure utilizing the Concordium Node SDK to facilitate signing and transaction operations on behalf of users. The current focus is guiding users through the identity creation process for Concordium identities. However, the generation of the redirect URI is resulting in an excessively large response, leading to browser failures due to URI size constraints.
Details:
Environment: Concordium Node SDK JS, specifically utilizing the wallet example provided at Concordium GitHub repository.
Issue: During the identity creation workflow, the redirect URI generated post identity request is exceptionally large. This size anomaly causes the browser to throw an error related to the URI being too large, thus halting the process.
N/A. The issue seems to be directly related to the size of the generated URI and might require optimization or alternative handling of the identity request response.
Screenshots/Logs:
A screenshot showcasing the browser error due to the large URI was attached with the report.
Any guidance or recommendations on how to address or work around this issue would be greatly appreciated. Specifically, insights into minimizing the size of the URI or alternative approaches to handling the identity request and response flow without causing browser limitations to be exceeded.
It’s not exactly redirect_uri that is the problematic part, it’s the “state” parameter.
Unfortunately this is the defined API between the wallet and identity providers. The request is a GET request with parameters being passed in the URL, and that cannot be changed without investment from identity providers.
The request is long because the state parameter contains a number of proofs that the person requesting knows the relevant secrets.
I’m surprised that the browser would complain, we’ve never seen that issue, but we have seen that some network infrastructure (application load balancers or proxies) have restricted long URLs.
After reformatting your code in the original message I just noticed that you are not actually sending the request, but rather the inputs to constructing the identity object request.
OKay but have you tried running the wallet example of late? Its broken
[vite] Internal server error: Failed to resolve entry for package “@concordium/web-sdk”. The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis
File: /Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/examples/wallet/src/CreateAccount.tsx
at packageEntryFailure (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28725:11)
at resolvePackageEntry (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28722:5)
at tryNodeResolve (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28453:20)
at Context.resolveId (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28212:28)
at async Object.resolveId (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44276:32)
at async TransformContext.resolve (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:43992:23)
at async normalizeUrl (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41836:34)
at async file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
at async Promise.all (index 6)
at async TransformContext.transform (file:///Users/emmanuel/Desktop/work_folder/concordium-node-sdk-js/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13)
Failed to resolve entry for package “@concordium/web-sdk”. The package may have incorrect main/module/exports specified in its package.json.
I may add one thing here, if you are using Mac M1 run this npm_config_target_arch=x64 yarn before installing dependencies. And I used this seed phrase generator but couldnt reproduce the issue you are having. Can you let us know if you are still facing?
The issue is not with running the code. It runs fine even if it shows those error in the console. However, after clicking the create identity button, it gets stuck forever on “Generating identity request. This can take a while.”. Seems the service workers arent triggering.
. How long is this expected to take?
Thats the issue. If that works on your end then i will check and see if its something wrong on my end