Authenticate in Unity or from a back end .net API service using JWT

We have our own openId server that authenticates users for our website and our Unity mobile app. On the website, when a user creates an account, we authenticate using AUTH_CONNECTION.CUSTOM and their JWT token. This is working fine and we get the users creds/wallet address returned.
We are trying to do the same in the mobile app when a user creates an account (we call our openId server and create, then return their JWT token), we then want to “sliently” (no popups/deep links, etc…) authenticate the user using their JWT token in order to get their wallet address. That is all we need at that point, we are not processing transactions using the wallet address. We just need the address.
Is there a way to do this silently/directly from Unity/C# calls or from our Backend .NET Web API services?

Thanks for your detailed question, Chris! Here’s a summary of your integration scenario and what the support team will need to assist you:


Context & Issue Summary

  • SDK/Platform: Web3Auth Plug and Play (PnP) Web SDK; exploring Unity mobile app and .NET backend integration.
  • Current Flow: On your website, you successfully authenticate users with your own OpenID server using AUTH_CONNECTION.CUSTOM and a JWT token, retrieving wallet addresses via Web3Auth.
  • Goal: Achieve the same “silent” JWT-based authentication in your Unity mobile app (C#) or from a backend .NET API—without user popups or deep links—just to retrieve the wallet address (no transaction signing).
  • Custom Auth: You’re using your own OpenID server and JWT tokens.
  • What’s Working: The flow works on your website using the Web SDK.
  • What’s Needed: Guidance on silent authentication with JWT in Unity/C# or .NET backend.

Key Details for Support

  • SDK Used: PnP Web SDK (on website)
  • Target Platform: Unity (C#) and/or .NET backend
  • Authentication Type: Custom JWT (from your OpenID server)
  • Verifier: Custom verifier registered on Web3Auth dashboard (assumed, since you’re using AUTH_CONNECTION.CUSTOM)
  • Desired Flow: Silent authentication (no UI) to retrieve wallet address

Additional Information Needed (if not already provided)

To help the support team give you the best possible answer, could you please confirm or provide:

  1. Verifier Name: The custom verifier name registered on the Web3Auth dashboard.
  2. JWKS Endpoint: The endpoint where Web3Auth can fetch your public keys for JWT verification.
  3. Sample idToken (JWT): (You can redact sensitive info.) This helps in debugging JWT parsing/claims if needed.
  4. Unity/.NET SDK Usage: Are you currently using any Web3Auth Unity SDK or calling the Web SDK from within Unity? Or are you planning to call the Web3Auth API directly from your backend?

Initial Guidance & Resources

  • Unity SDK Support: As of now, Web3Auth’s Unity SDK is primarily designed for client-side authentication flows. You can check the Unity SDK docs here.
  • Silent Authentication: For “silent” JWT-based login (no popups), you’d typically use the Single Factor Auth (SFA) SDK, which is available for web/JavaScript (docs). There isn’t a direct .NET/C# SDK for SFA as of now.
  • Backend Authentication: Web3Auth is designed to operate as a client-side authentication system; server-to-server flows are not natively supported, and private key material is never exposed to the backend for security reasons. See this community answer for more context.
  • Unity Integration: If you want to perform JWT-based login in Unity, you’d need to use the Unity SDK and invoke the login method with your JWT. See Unity custom JWT login guide.

Proposed Solution

  • For Unity: Use the Unity SDK’s custom authentication flow, passing in your JWT. This will be a client-side flow, but you can design it to be silent (no popups) if you control the UI.
  • For .NET Backend: Direct backend authentication is not supported, as Web3Auth does not expose private keys or wallet addresses server-side for security. The recommended flow is for the client (Unity app) to authenticate and then pass the wallet address to your backend if needed.

Next Steps

  • Please confirm your verifier name and JWKS endpoint, and clarify if you’re using the Unity SDK or planning a direct backend integration.
  • If you have code snippets for your Unity or .NET integration attempts, please share them for more targeted help.

Let us know if you need code examples for the Unity custom JWT flow or further clarification on backend limitations!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

I understand the the authentication is meant to be client-side and not server to server. Most of the links in the bot reply don’t exist anymore (404s).
I’m still looking for a way to authenticate from our Unity app wihout any intermediate popups using the custom/JWT auth flow.