-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assistance with SIWE #41
Comments
Hello @rhamnett, here you can see how we constructed our SIWE service example https://github.com/reown-com/reown_flutter/blob/develop/packages/reown_appkit/example/modal/lib/services/siwe_service.dart
But this is just how we constructed it for explanatory purposes, you don't necessarily need to follow our way. Essentially the SIWEConfig we provide it's just "glue" between AppKit and your backend service but your backend service can be whatever you want |
Thanks so much again for your response. I have copied the entire siwe service and I can see a successful request for a nonce but I never get a call to the verify/auth. I must be missing something. |
Because you are missing a bunch of --dart-define variable that we run on our side. Again, the purpose of that SIWE service is just explanatory. |
OK thanks I'll figure it out. |
@quetool in the original post I did mention that I provide the I can't see any other defines that I might be missing, so just curious as to any pointers? |
Any chance you can share your project so I can clone and run? |
Yes it was in the original post instructions: |
Yes, sorry, allow me some time |
No problem at all, please take your time - appreciate any support. |
Hello @rhamnett, I do see Replace your void _initializeService(_) async {
ReownAppKitModalNetworks.removeTestNetworks();
ReownAppKitModalNetworks.removeSupportedNetworks('solana');
// Add this network as the first entry
final etherlink = ReownAppKitModalNetworkInfo(
name: 'Etherlink',
chainId: '42793',
currency: 'XTZ',
rpcUrl: 'https://node.mainnet.etherlink.com',
explorerUrl: 'https://etherlink.io',
chainIcon: 'https://cryptologos.cc/logos/tezos-xtz-logo.png',
isTestNetwork: false,
);
ReownAppKitModalNetworks.addSupportedNetworks('eip155', [etherlink]);
try {
_appKitModal = ReownAppKitModal(
context: context,
projectId: DartDefines.projectId,
logLevel: LogLevel.all,
metadata: _pairingMetadata(),
siweConfig: _siweConfig(true),
enableAnalytics: true, // OPTIONAL - null by default
includedWalletIds: {},
featuredWalletIds: {
'f71e9b2c658264f7c6dfe938bbf9d2a025acc7ba4245eea2356e2995b1fd24d3', // m1nty
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // Metamask
},
);
overlay = OverlayController(
const Duration(milliseconds: 200),
appKitModal: _appKitModal,
);
_toggleOverlay();
setState(() => _initialized = true);
} on ReownAppKitModalException catch (e) {
debugPrint('⛔️ ${e.message}');
return;
}
// modal specific subscriptions
_appKitModal.onModalConnect.subscribe(_onModalConnect);
_appKitModal.onModalUpdate.subscribe(_onModalUpdate);
_appKitModal.onModalNetworkChange.subscribe(_onModalNetworkChange);
_appKitModal.onModalDisconnect.subscribe(_onModalDisconnect);
_appKitModal.onModalError.subscribe(_onModalError);
// session related subscriptions
_appKitModal.onSessionExpireEvent.subscribe(_onSessionExpired);
_appKitModal.onSessionUpdateEvent.subscribe(_onSessionUpdate);
_appKitModal.onSessionEventEvent.subscribe(_onSessionEvent);
// relayClient subscriptions
_appKitModal.appKit!.core.relayClient.onRelayClientConnect.subscribe(
_onRelayClientConnect,
);
_appKitModal.appKit!.core.relayClient.onRelayClientError.subscribe(
_onRelayClientError,
);
_appKitModal.appKit!.core.relayClient.onRelayClientDisconnect.subscribe(
_onRelayClientDisconnect,
);
// _appKitModal.appKit!.core.addLogListener(_logListener);
//
await _appKitModal.init();
DeepLinkHandler.init(_appKitModal);
DeepLinkHandler.checkInitialLink();
setState(() {});
} |
@quetool Thanks again - I can see your verify attempts in my backend logs. The issue appears to be when I am using social logins, can you try with apple signin? i dont see any verify request in the backend....it hangs. |
Is social features working for you or do you see any errors when loading appkit? |
if i turn off swe then i can log in fine with Apple, when turning on SWIE i get it hanging after it's successfully got the nonce from the server, pls see my original post for the error log :) |
Hello @rhamnett! Can you add this somewhere in your widget tree? AppKitModalAccountButton(appKitModal: appKit, custom: const SizedBox.shrink()), |
Sure. Do you want me to replace the existing or add this as well as? |
Add this in a part of the widget tree that doesn't get disposed |
@quetool that works, thanks again. Is this something I have simply done wrong or is there a fix required? |
Probably something that we can do better on our side. We'll take a look in the coming days and let you know. |
Thanks! No rush here, no blockers. Will re-open to keep it on the list. |
Describe the bug
Hello, the documentation lacks an example of a SIWE server. I was wondering if you can kindly help me debug my implementation.
When SIWE is enabled, the wallet successfully makes a request to
/auth/v1/nonce
and I can see a reply, but I never see a call to/auth/v1/authenticate
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/rhamnett/reown_flutter.git
flutter run --dart-define="PROJECT_ID=3de10c688399aa49889ff67453c20ae4" --dart-define="AUTH_SERVICE_URL=https://2264vhbgqg.execute-api.eu-west-1.amazonaws.com"
final siweAuthValue = prefs.getBool('appkit_siwe_auth') ?? true;
Error log:
My attempt at a SIWE server:
Expected behavior
/auth/v1/authenticate
endpoint gets calledThe text was updated successfully, but these errors were encountered: