sui icon indicating copy to clipboard operation
sui copied to clipboard

I cannot generate the account with Enoki. "Invalid client id"

Open spielcrypto opened this issue 7 months ago • 3 comments

Steps to Reproduce Issue

  1. I generate the nonce with this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#create-zklogin-nonce

  2. I generate the url as mention here https://docs.sui.io/guides/developer/cryptography/zklogin-integration#get-jwt

  3. I'm available to login in google and it redirect correctly with the jwt generated and this Jwt is correct according with the documentation and I decode it, it shows my client id in aud and azp also has all the required fields

  4. however if I request this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#create-zklogin-zkp or this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#get-address-for-zklogin-user and I get invalid_client_id

Expected Result

I shouldn't get any error if I execute the mentioned endpoints

Actual Result

called Result::unwrap() on an Err value: Network("Account request failed with status 400 Bad Request: {"errors":[{"code":"invalid_client_id","message":"Invalid client ID"}]}")

Code

To generate the Oauth url: https://github.com/Singularity-Shift/squad_connect/blob/main/src/service/services.rs#L50

To get the account: https://github.com/Singularity-Shift/squad_connect/blob/main/src/service/services.rs#L182

To get the zk proof: https://github.com/Singularity-Shift/squad_connect/blob/main/src/service/services.rs#L129C14-L129C22

However I try to send directly the request by curl and the same issue

System Information

  • OS: Manjaro Linux
  • Compiler: cargo and rustc 1.85.0

spielcrypto avatar May 25 '25 10:05 spielcrypto

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

github-actions[bot] avatar May 25 '25 10:05 github-actions[bot]

The issue is resolved, just I needed to add the google client id to my Enoki app account, however with the response data of this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#get-address-for-zklogin-user if it is possible to create the SuiWallet object or do I need to call for it this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#create-zklogin-zkp

spielcrypto avatar May 25 '25 15:05 spielcrypto

The issue is resolved, just I needed to add the google client id to my Enoki app account, however with the response data of this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#get-address-for-zklogin-user if it is possible to create the SuiWallet object or do I need to call for it this endpoint https://docs.enoki.mystenlabs.com/http-api/openapi#create-zklogin-zkp

You can derive the wallet simply from the get-address call without requesting a proof but if you want your user to be able to sign transactions, they will need the zkp as well.

StefPler avatar May 26 '25 08:05 StefPler