.NET/Unity - Enhancing In-App & Ecosystem Wallet Authentication Methods & Compatibility
Pushing the limits of Unity x Web3.
.NET v2.16.0 Release
What's Changed
AuthProvider.SiweExternal - SIWE, OAuth style
Depending on the framework, or on the external wallet platform support, you may not have direct access to every single wallet out there.
This new AuthProvider allows you to login to otherwise native-unavailable wallets such as Abstract Wallet & Coinbase Smart Wallet through a flow similar to OAuth, using SIWE.
It'll redirect you to static.thirdweb.com and use our React SDK and other wallet SDKs as needed, unlocking the ability to login (or link) with any wallet thirdweb supports on web, from runtime platforms that would otherwise be unsupported by said wallet, and create an In-App or Ecosystem Wallet out of it.
Windows Console Example:
var inAppWalletSiweExternal = await InAppWallet.Create(client: client, authProvider: AuthProvider.SiweExternal);
var address = await inAppWalletSiweExternal.LoginWithSiweExternal(
isMobile: false,
browserOpenAction: (url) =>
{
var psi = new ProcessStartInfo { FileName = url, UseShellExecute = true };
_ = Process.Start(psi);
},
forceWalletIds: new List<string> { "io.metamask", "com.coinbase.wallet", "xyz.abs" }
);
You can now override the default session id used with Guest authentication
This is useful when you want your guest mode to be tied to a unique device identifier, and depending on your framework there may be various APIs to fetch such identifiers that you may want to use.
Example:
var guestWallet = await EcosystemWallet.Create(
ecosystemId: "ecosystem.the-bonfire",
client: client,
authProvider: AuthProvider.Guest
);
var address = await guestWallet.LoginWithGuest(SomeSystemInfoAPI.deviceUniqueIdentifier);
Unity 5.16.0 Release
What's Changed
- Additions from Thirdweb's .NET SDK Release 2.16.0
- Integrated
AuthProvider.SiweExternal
in ThirdwebManager.- Work around your favorite external wallet not having Unity support.
- OAuth style linking variant of
AuthProvider.Siwe
, but using wallets and SIWE in a static React environment.
var walletOptions = new WalletOptions(
WalletProvider.InAppWallet,
421614,
new InAppWalletOptions(authprovider: AuthProvider.SiweExternal)
);
var wallet = await ConnectWallet(walletOptions);
ThirdwebDebug.Log("Connected to InAppWallet with SiweExternal auth provider." + await wallet.GetAddress());
AuthProvider.Guest
now uses a unique device identifier, making it a little more persistent than the previous implementation.- Guest mode is meant as an ephemereal login method, you should allow users to link additional auths later in the flow.
- This update makes Guest mode a little more persistent in cases where users delete something by mistake.
- Fixed edge case where
Application.identifier
being an empty string with some build configs would cause an empty bundle id to be used as the fallback instead of com.company.product.