# \[Archive\] Capacitor Android Issue (Custom Discord Authentication)

**URL:** <https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [August 23, 2022, 4:24am UTC](https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426 "2022-08-23T04:24:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [August 23, 2022, 4:24am UTC](https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426/1 "2022-08-23T04:24:26Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **githubdiscussions** on 8/23/2022.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

We have a React/Capacitor application wired up to use web3Auth + Discord Login. We have used the following guide [Discord Guide](https://web3auth.io/docs/custom-authentication/social-providers/discord) to get setup & have it working successfully for **WEB** & **IOS**. But we are currently running into an issue with native android devices.

At the moment when a user triggers the discord login from within our app the user is redirected to the following page (Open Login) & nothing happens, upon further investigation of the source maps we get an error about `redirectUrl` does not exist. But we have set that in our `adapterSettings`.

[![Screen Shot 2022-08-22 at 9 01 53 PM](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/9/9797ff0fde1cd4db2f5a06ba66a643ef267d8862.png)](https://user-images.githubusercontent.com/40479121/186068090-49ed7c94-0f42-42ba-a121-59f63882b129.png)

Here is a snippet of our initialization code.

\<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const web3AuthInit = async () =\> { try { setInitLoading(true) const web3authCore = new Web3AuthCore({ chainConfig: { chainNamespace: CHAIN\_NAMESPACES.EIP155, chainId: '0x1', rpcTarget: 'https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c', blockExplorer: 'https://etherscan.io/', ticker: 'ETH', tickerName: 'Ethereum', }, enableLogging: true, })

```
  const adapter = new OpenloginAdapter({
    adapterSettings: {
      network: 'testnet',
      clientId:
        'XXX',
      uxMode: 'redirect',
      redirectUrl: &quot;XXX&quot;
      loginConfig: {
        discord: {
          name: 'discord',
          verifier: 'discord-learn-card-verifier',
          typeOfLogin: 'discord',
          clientId: 'XXX',
          mainOption: true,
          showOnMobile: true,
          showOnDesktop: true,
        },
      },
    },
  })
web3authCore.configureAdapter(adapter)
subscribeAuthEvents(web3authCore)
web3AuthStore.set.web3Auth(web3authCore)

```

}"\>

```
constweb3AuthInit=async()=\>{
try{
setInitLoading(true)
constweb3authCore=newWeb3AuthCore({
chainConfig:{
chainNamespace:CHAIN\_NAMESPACES.EIP155,
chainId:‘0x1’,
rpcTarget:
‘[https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c](https://mainnet.infura.io/v3/776218ac4734478c90191dde8cae483c)’,
blockExplorer:‘[https://etherscan.io/](https://etherscan.io/)’,
ticker:‘ETH’,
tickerName:‘Ethereum’,
},
enableLogging:true,
})

```
  <span class="pl-k">const</span> <span class="pl-s1">adapter</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">OpenloginAdapter</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">adapterSettings</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">network</span>: <span class="pl-s">'testnet'</span><span class="pl-kos">,</span>
      <span class="pl-c1">clientId</span>:
        <span class="pl-s">'XXX'</span><span class="pl-kos">,</span>
      <span class="pl-c1">uxMode</span>: <span class="pl-s">'redirect'</span><span class="pl-kos">,</span>
      <span class="pl-c1">redirectUrl</span>: <span class="pl-s">"XXX"</span>
      <span class="pl-s1">loginConfig</span>: <span class="pl-kos">{</span>
        <span class="pl-s1">discord</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">name</span>: <span class="pl-s">'discord'</span><span class="pl-kos">,</span>
          <span class="pl-c1">verifier</span>: <span class="pl-s">'discord-learn-card-verifier'</span><span class="pl-kos">,</span>
          <span class="pl-c1">typeOfLogin</span>: <span class="pl-s">'discord'</span><span class="pl-kos">,</span>
          <span class="pl-c1">clientId</span>: <span class="pl-s">'XXX'</span><span class="pl-kos">,</span>
          <span class="pl-c1">mainOption</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
          <span class="pl-c1">showOnMobile</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
          <span class="pl-c1">showOnDesktop</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class=“pl-s1”>web3authCore</span><span class=“pl-kos”>.</span><span class=“pl-en”>configureAdapter</span><span class=“pl-kos”>(</span><span class=“pl-s1”>adapter</span><span class=“pl-kos”>)</span>
<span class=“pl-en”>subscribeAuthEvents</span><span class=“pl-kos”>(</span><span class=“pl-s1”>web3authCore</span><span class=“pl-kos”>)</span>
<span class=“pl-s1”>web3AuthStore</span><span class=“pl-kos”>.</span><span class=“pl-c1”>set</span><span class=“pl-kos”>.</span><span class=“pl-en”>web3Auth</span><span class=“pl-kos”>(</span><span class=“pl-s1”>web3authCore</span><span class=“pl-kos”>)</span>

```

}
```
  
   
 Originally posted by: [gerardopar](https://github.com/gerardopar)  
   
 Check the discussion at: [https://github.com/orgs/Web3Auth/discussions/460](https://github.com/orgs/Web3Auth/discussions/460)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [September 5, 2022, 12:57pm UTC](https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426/2 "2022-09-05T12:57:11Z")

</div>

Hey [@gerardopar](https://github.com/gerardopar)

What's your `redirectUrl`? Also, have you whitelisted that in the dashboard?

And please note:

[![Screenshot 2022-09-05 at 6 25 52 PM](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/2/2fa43238d787f7e5702d4fd65aa0553b71d61b8f.png)](https://user-images.githubusercontent.com/6962565/188454482-efbc6072-b388-470a-b5ae-14f37bdffbc3.png)

https://web3auth.io/docs/sdk/web/openlogin#openloginloginparams  
   
 Originally posted by: [shahbaz17](https://github.com/shahbaz17)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [September 5, 2022, 6:25pm UTC](https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426/3 "2022-09-05T18:25:59Z")

</div>

Please note that for Android, your URL looks similar to `{YOUR_APP_PACKAGE_NAME}://auth`

  
   
 Originally posted by: [yashovardhan](https://github.com/yashovardhan)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [September 7, 2022, 7:01am UTC](https://builder.metamask.io/t/archive-capacitor-android-issue-custom-discord-authentication/2426/4 "2022-09-07T07:01:52Z")

</div>

[@shahbaz17](https://github.com/shahbaz17) [@yashovardhan](https://github.com/yashovardhan) After doing an _immense_ amount of debugging, I've been able to localize the problem within the `@toruslabs/openlogin` package. It seems that, for some reason, in this specific environment, third party cookies _aren't_ working correctly!

To workaround this, I have set `no3PC` to `true`, but on the current version of `@web3auth/openlogin-adapter`, this will cause the adapter to fail to initialize due to an invalid check inside the `@toruslabs/openlogin` package. Fortunately, that has already been fixed (see [this commit](https://github.com/torusresearch/OpenLoginSdk/commit/5045f4bb0d2da4e33e8b6254ddeb9f81de216d2f)) upstream! The problem is that `@web3auth/openlogin-adapter` doesn't have the latest version of `@toruslabs/openlogin` bumped in its package json yet, so the code that ultimately gets pulled in still does not work.

I have put up [this PR](https://github.com/Web3Auth/Web3Auth/pull/564) to address this. Hopefully with that merged in and a new package released, this should start working! I have tested manually editing the compiled `@toruslabs/openlogin` file, and it has been working for me!

  
   
 Originally posted by: [TaylorBeeston](https://github.com/TaylorBeeston)
