hi @shahbaz
i have facing issue in custom jwt Auth.Unable to detect login share from the Auth Network. This may be due to slow internet connection. Check your internet speed and try again. If you’re using a vpn, please turn it off. This the error msg i getting when i am try to login
And I have attached the dropBox Link whith screenshoot and video.And i have attached my code.
check the link
this is my code
in Server how i create Jwt
export const JwtSign = async (req, res) => {
var privateKey = fs.readFileSync(“./privateKey.pem”);
// openssl rsa -in privateKey.pem -pubout -out publicKey.pem
var publicKey = fs.readFileSync(“./publicKey.pem”);
var token = jwt.sign(
{
sub: ‘LazyminterLive’, // must be unique to each user
name: ‘LazyminterLive’,
email: “akashswamy.maticz@gmail.com”,
aud: “urn:my-resource-server”,
iss: “https://lazyminter.com”, // → to be used in Custom Authentication as JWT Field
iat: Math.floor(Date.now() / 1000),
exp: Math.floor(Date.now() / 1000) + 60 * 60,
},
privateKey,
{ algorithm: “RS256”, keyid: “1bb9605c36e98e30117a69517569386830202b2d” } // ← This has to be present in the JWKS endpoint.
);
console.log(“awewqeqweqw”, token);
var decoded = jwt.verify(token,publicKey);
console.log(“https://lazyminter.com/”, decoded);
res.json({ token: token })
}
This my web3Auth no model Code
const web3auth = new Web3AuthNoModal({
clientId: "BJNPN4rwFBDyKHIA39E70tpzdc_LWOr69JM4Y_I9MFmhvyZ400du2rknToRZlpt5zu5q-xrnDTwa9p_OSiEqwcU",
web3AuthNetwork: "testnet",
chainConfig: {
chainNamespace: "eip155",
chainId: "0x13881",
rpcTarget: "https://matic-mumbai.chainstacklabs.com",
displayName: "Polygon Mumbai Testnet",
blockExplorer: "https://mumbai.polygonscan.com/",
ticker: "MATIC",
tickerName: "Matic",
},
});
console.log("initial Web3Auth", web3auth);
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
loginConfig: {
jwt: {
verifier: "web3auth-custom-jwt",
typeOfLogin: "jwt",
clientId:"BJNPN4rwFBDyKHIA39E70tpzdc_LWOr69JM4Y_I9MFmhvyZ400du2rknToRZlpt5zu5q-xrnDTwa9p_OSiEqwcU",
},
},
},
});
console.log("openloginAdapteropenloginAdapter", openloginAdapter);
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
var JwtSignTokenCall = await GetJwtToken()
if (JwtSignTokenCall.data.data.token !== undefined) {
console.log("GetJwtToken IS comming", JwtSignTokenCall.data.data.token);
const web3authProvider = await web3auth.connectTo(
WALLET_ADAPTERS.OPENLOGIN,
{
loginProvider: "jwt",
extraLoginOptions: {
id_token: String(JwtSignTokenCall.data.data.token),
verifierIdField: "email",
// domain: "https://lazyminter.com/",
},
}
);
}
console.log("web3authProvider", web3authProvider);
this how i get my public and privatekey
openssl genrsa -out private.pem 512
openssl rsa -in private.pem -pubout -out public.pem
@shahbaz