How to add referrer in an ionic capacitor app

I am using web3auth in an ionic capacitor app. However, the redirect popup does not work and shows up blank.
On checking the console logs with the iOS simulator it shows OpenLogin - RPC Error: redirectUrl is not on origin.

I have tried to whitelist the below URLs:
://auth
ionic://auth
https://app.openlogin.com
ionic:/
capacitor://localhost
capacitor://auth

But none of these work
Screenshot 2022-08-10 at 3 32 31 PM

How should we add a referer or add a redirectURL?



Originally posted by: manish1408

Check the discussion at: https://github.com/orgs/Web3Auth/discussions/396

Hey @manish1408 your whitelist url will be your bundle Identifier for your iOS app followed by ://auth so something like this (xyz://auth) where xyz is your bundle Identifier which can be found in Targets -> General



Originally posted by: dhruv500

Openlogin cannot verify mobile origins, so you need to host a webpage for your app which and pass the URL of that webpage in the openloginAdapter loginSettings param as shown below and from you webpage, you can redirect to your mobile app.

The flow will look like this:-

Your app (using web3auth sdk) =>(Redirects to) => Openlogin.com (user will complete login here) => (After login, Redirects to your webpage) => Your hosted webpage =>(Redirects to) => Your IONIC app

Sample Code:-


const openloginAdapter = new OpenloginAdapter({
“loginSettings”: {
“redirectUrl”: “your web page url”
}
})

web3auth.configureAdapter(openloginAdapter)

Note: You will need to whitelist your webpage url rather thn mobile app uri in this case.



Originally posted by: himanshuchawla009