Replies: 2 comments
-
|
Yes, Web3Auth supports all login providers that return If you're using import { Web3AuthCore } from "@web3auth/core";
import { WALLET_ADAPTERS, CHAIN_NAMESPACES } from "@web3auth/base";
const web3auth = new Web3AuthCore({
clientId: "YOUR-WEB3AUTH-CLIENT-ID-FROM-PLUG-AND-PLAY",
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: {
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",
},
});And follow the steps mentioned https://web3auth.io/docs/custom-authentication/byo-jwt-providers#set-up-custom-jwt-verifier for setting a Verifier on Web3Auth Dashboard. It is important that the
If you're not using other providers to get 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);Guides:
|
Beta Was this translation helpful? Give feedback.
-
|
i have a question please, how i do to get the id token , because my login provider authority doesn't provide an id token it provide just client id and client secret . |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, Web3Auth supports
Google,Facebook,Twitch,Discord, andAuth0natively on the Developer Dashboard. If someone wishes to useFirebase,AWS Cognito,Okta, or any other login provider that returnsidTokenafter successful authentication. Can they use Web3Auth? and does it support this use case?Beta Was this translation helpful? Give feedback.
All reactions