Web3auth social login suddenly stopped working on mainnet, getting following errors in console, please find the screenshots attached

Hey @patrick @akashswamy.maticz

I have noticed that there are several inquiries in this thread. Would you be willing to create a separate thread for each question? This approach will allow us to concentrate on one issue at a time and resolve it efficiently. Thank you.

Hi @shahbaz, it is the same inquiry from @akashswamy.maticz so we can keep only this

Sure @patrick

Let’s close this one. I see two issues here:

  1. Modal not showing login options: Probably whitelabel or BigInt issue. Need to see the browser console to know the root cause.
  2. JWKS endpoint issue: Need to know how the JWKS are generated?

Hi @shahbaz

We need reply only for the issue no 2.

This how I generated the Jwks

const kid = ‘RkI5MjI5OUY5ODcQ4QzM0OUYzGMTJDOUEzQkFCOTU3NjE2Rg’;
var pem2jwk = require(‘pem-jwk’).pem2jwk;
var publicKey = fs.readFileSync(“/var/www/backend/v1/controllersFrontend/public.pem”);
console.log(“asdsadasdasdas”, publicKey);
const jwk = pem2jwk(publicKey);
res.json({
keys: [{
…jwk,
kid,
use: ‘sig’,
alg: ‘RS256’
}]
});

this is how i generated my jwks.And my endpoint is (https://apistaging.lazyminter.com/v1/token/JwtSign)

Yes, focus on issue no.2. Thanks all…

Hey @akashswamy.maticz

And how did you generate your public.pem file?

Also, use this thread to convert the pem to jwks: How to create JWKS from PEM format

This kid is not present in the JWKS endpoint.

Hi @shahbaz

I have created the jwks endpoints as per your github link. This is my endpoint(https://apistaging.lazyminter.com/v1/token/JWTEndPoints). I am still facing the same issue Invalid JWKS endpoint . I have attached the file check it.And i have attached the code

const data = require(‘./JWKS.json’)

// console.log(“qweqwzxczxcasd”,readFile);

res.header(“Content-Type”, ‘application/json’);

res.sendFile(path.resolve(‘./JWKS.json’));

Please share the detailed answer to this.

What are these?

Also, please share a sample id_token.

Hey @patrick and team

I did a workaround for this to test.

  1. Copied the JWKS from your provided endpoint, formatted it in a JSON formatted, and hosted it https://gist.githubusercontent.com/shahbaz17/957dbc4fa9760436419f01c212b68983/raw/89765330b0fbc5ab869dc142bd0427f71d1e661a/test-jwks.json
  2. By doing so, I was able to create a new verifier.

@shahbaz thanks so much, will get the team try.

Hi @shahbaz

I have created the JWKS endpoint as per you github link.okay will check it again

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

Hi @shahbaz, thanks for your advice.

Hope to receive your response soon :slight_smile:

Hey @shahbaz, how wait it. Hope to hear some guidance from your side.

Hey @patrick and team,

Was on leave past couple of days, let me look at this now.

Hey @akashswamy.maticz

Did you create this verifier? If so, could you share the JWKS endpoint here?

@patrick Looks like there’s a lot of confusion here, we better get on a call and fix these.

@shahbaz @akashswamy.maticz yes, are you available today at around 1pm sg time? can I have your mail so I can arrange a call?