Whitelisting domains from our backend and not web3auth dashboard

we are trying to whitelist domains from our backend instead from your dashboard, we found in the community a snippet of code from 2022 that shows how to do it, but our dev says there no option to add original data inside the adapterSettings.
this is the snippet we found:

const whitelistedDomains = {
https://tenant1.example.com”: “TENANT1_ DOMAIN_SIGNATURE”,
// signature that you generated above in step 3
https://tenant2.example.com”: “TENANT2_ DOMAIN_SIGNATURE”,
}
const adapter = new OpenloginAdapter({ adapterSettings: { originData: whitelistedDomains } });

we are using :

    "@web3auth/auth-adapter": "^9.4.4",
    "@web3auth/base": "^9.4.4",
    "@web3auth/ethereum-provider": "^9.4.4",
    "@web3auth/no-modal": "^9.4.4",
    "@web3auth/no-modal-react-hooks": "^9.4.4",
    "@web3auth/openlogin-adapter": "^8.12.4",
    "@web3auth/wallet-connect-v2-adapter": "^9.4.4",

was wondering how it can be impletemed using our piece of code
import { AuthAdapter } from “@web3auth/auth-adapter”;
import { IWeb3AuthCoreOptions, WEB3AUTH_NETWORK } from “@web3auth/base”;
import { EthereumPrivateKeyProvider } from “@web3auth/ethereum-provider”;
import { Web3AuthNoModal } from “@web3auth/no-modal”;
import state from ‘…/…/state’;
const initWeb3Auth = async (): Promise => {
try {
const privateKeyProvider = new EthereumPrivateKeyProvider({
config: {
chainConfig: state.web3AuthCfg as any
},
});
const web3AuthOptions: IWeb3AuthCoreOptions = {
clientId: state.web3_auth_token,
web3AuthNetwork: WEB3AUTH_NETWORK.CYAN,
privateKeyProvider,
};
const web3auth = new Web3AuthNoModal(web3AuthOptions);
const authAdapter = new AuthAdapter();
web3auth.configureAdapter(authAdapter);
await web3auth.init();
return web3auth;
} catch (error) {
console.error(“Web3Auth initialization error:”, error);
throw error;
}
};
export default initWeb3Auth;

Hello ido bino! Thank you for sharing the details of your issue with whitelisting domains from your backend. It sounds like you’re trying to adapt the code for your specific needs, which is great!

Based on your message, here’s a summary for the support team:

Issue Summary:

  • SDK Details: Help - Plug n Play
  • SDK Version Numbers:
    • @web3auth/auth-adapter: ^9.4.4
    • @web3auth/base: ^9.4.4
    • @web3auth/ethereum-provider: ^9.4.4
    • @web3auth/no-modal: ^9.4.4
    • @web3auth/no-modal-react-hooks: ^9.4.4
    • @web3auth/openlogin-adapter: ^8.12.4
    • @web3auth/wallet-connect-v2-adapter: ^9.4.4
  • Platform: Not explicitly mentioned, but appears to be JavaScript/TypeScript.

Details of the Issue:

  • You are attempting to whitelist domains from your backend but are having trouble because your developer indicates there is no option to add original data inside the adapterSettings.
  • You referenced a code snippet from 2022 which shows how to set up whitelisted domains, but it seems it may not align with the current SDK.

Proposed Steps:

  1. Check Current SDK Documentation: The SDK and adapter properties may have changed since the snippet you found. It would be best to refer to the most recent documentation for OpenloginAdapter and AuthAdapter.
  2. Implementation in Your Code: The whitelisting may require adapting to the current structure of your code. There might be new parameters or methods available that are not present in the older snippet.

Questions for Further Clarification:

  • Are you getting any specific errors when implementing this, or is it mainly a matter of configuration?
  • Do you have any specific links to the documentation or community threads addressing this issue?

Thank you for sharing your code snippet too! It helps provide context for the issue. I hope the support team can assist you further! If you have any more questions or need clarification, feel free to ask!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

  1. const authAdapter = new AuthAdapter({ adapterSettings: originData: [‘https://www.text.com’]});
    exmaple for error, seems there is no originDate inside adapterSettings…

  2. Developer dashboard api for whitelisting domains. · Web3Auth · Discussion #398 · GitHub

hello? anyone? please help

Hi,
you can refer this to configure manual whitelisting