Replies: 12 comments 17 replies
-
pls share console errors, if any |
Beta Was this translation helpful? Give feedback.
-
@rinzler99 console errors. |
Beta Was this translation helpful? Give feedback.
-
Hey @suyash515 Which login provider are you using? This looks like the authentication didn't happen. If you're, you are using a custom authentication provider(that are not natively supported on the verifier dashboard) that returns import { Web3AuthCore } from "@web3auth/core";
import { WALLET_ADAPTERS, CHAIN_NAMESPACES } from "@web3auth/base";
const web3auth = new Web3AuthCore({
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155, // SOLANA, OTHER
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
displayName: "Ethereum Mainnet",
blockExplorer: "https://etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
},
});
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId: "YOUR-WEB3AUTH-CLIENT-ID-FROM-PLUG-AND-PLAY",
network: "testnet",
uxMode: "redirect", // also support popup
loginConfig: {
jwt: {
name: "Name of your choice",
verifier: "YOUR-VERIFIER-NAME-ON-WEB3AUTH-DASHBOARD-FROM-CUSTOM-AUTH",
typeOfLogin: "jwt",
clientId: "YOUR-WEB3AUTH-CLIENT-ID-FROM-PLUG-AND-PLAY",
},
},
},
});
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "jwt",
extraLoginOptions: {
id_token: idToken,
verifierIdField: "sub", // same as your JWT Verifier ID
domain: "https://YOUR-APPLICATION-DOMAIN" || "http://localhost:3000",
},
}); Also, Please follow each step mentioned https://web3auth.io/docs/custom-authentication/byo-jwt-providers#set-up-custom-jwt-verifier for setting a Verifier. |
Beta Was this translation helpful? Give feedback.
-
@shahbaz17 Thanks so much for the reply. The reason is that we have control over the custom login provider and can have any required values returned based on your requirements. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's correct. That should return an
Check https://web3auth.io/docs/custom-authentication/byo-jwt-providers#using-jsonwebtoken for more details on how to generate an idToken. Using jose, it would look something like this: import * as jose from "jose";
import fs from "fs";
// openssl genrsa -out privateKey.pem 512
var privateKey = fs.readFileSync("privateKey.pem");
// openssl rsa -in privateKey.pem -pubout -out publicKey.pem
var publicKey = fs.readFileSync("publicKey.pem");
// https://my-authz-server/.well-known/jwks.json -> to be used in Custom Authentication as JWK Endpoint.
// Signing the JWT
const jwt = await new jose.SignJWT({ "urn:example:claim": true })
.setProtectedHeader({ alg: "RS256", kid: "1bb9605c36e{your_kid}69386830202b2d" })
.setIssuedAt()
.setIssuer("https://my-authz-server")
.setAudience("urn:my-resource-server")
.setExpirationTime("2h")
.sign(privateKey); |
Beta Was this translation helpful? Give feedback.
-
@shahbaz17 Thank you. Let me try this and revert back. |
Beta Was this translation helpful? Give feedback.
-
Hey @suyash515 Have you tried this? |
Beta Was this translation helpful? Give feedback.
-
@shahbaz17 We are still working on this. I will have an update on this later today. |
Beta Was this translation helpful? Give feedback.
-
@shahbaz17 we have tried the above solution but getting the following error: This is the code that I am using:
Basically, we are redirecting back to https://beta.openlogin.com/auth?idToken=token |
Beta Was this translation helpful? Give feedback.
-
Hi @shahbaz17
idToken is in JWT format containing the following data:
|
Beta Was this translation helpful? Give feedback.
-
This is resolved now. |
Beta Was this translation helpful? Give feedback.
-
is your issue resolved, If not , Can you also attach console logs along with the screenshots that you posted above. Also can you check if your third party cookies are blocked while using solana wallet. |
Beta Was this translation helpful? Give feedback.
-
I am getting the following issue on my end and these are the steps to reproduce the error:
Originally posted by @suyash515 in #446 (comment)
Beta Was this translation helpful? Give feedback.
All reactions