Authenticate to web3auth with JWT without redirection

Hello!

I’m using web3auth with JWT and it’s working fine.

What I’m looking for is a way to send the authenticate with JWT without the need of redirecting or opening any new tab, and make it all done silently on the client side.

is that possible?

here is my current code:

const privateKeyProvider = new EthereumPrivateKeyProvider({
					config: { chainConfig },
				});

				const web3auth = new Web3AuthNoModal({
					clientId: process.env.REACT_APP_WEB3AUTH_CLIENT_ID as string,
					web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
					privateKeyProvider,
				});

				const openloginAdapter = new OpenloginAdapter({
					adapterSettings: {
						uxMode: UX_MODE.REDIRECT,
						loginConfig: {
							jwt: {
								verifier: process.env.REACT_APP_WEB3AUTH_JWT_VERIFIER as string,
								typeOfLogin: "jwt",
								clientId: process.env.REACT_APP_WEB3AUTH_CLIENT_ID as string,
							},
						},
					},
				});
				web3auth.configureAdapter(openloginAdapter);
				setWeb3auth(web3auth);

				await web3auth.init();
				setProvider(web3auth.provider);
				if (web3auth.connected) {
					setWeb3authLoggedIn(true);
				}

Hey @benharkatdjalil,

Welcome to the community! I understand you’re aiming to avoid any new tabs or redirections in your user experience. For this purpose, I suggest exploring our Single Factor Authentication (SFA) Web SDK, which is designed to meet such requirements seamlessly.

You might find this example with JWT integration particularly helpful. It demonstrates how to use the SDK in a way that might align with what you’re envisioning.

Please try setting it up locally and see how it works for your project. I’m eager to hear your thoughts and whether it meets your expectations. If you have any questions or need further assistance, don’t hesitate to reach out!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.