# Flutter webAuth redirects to not found page

**URL:** <https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557>\
**Category:** Get Help\
**Tags:** flutter\
**Created:** [August 29, 2022, 4:30am UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557 "2022-08-29T04:30:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.runin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jose.runin/32/34928_2.png) [@jose.runin](https://community.auth0.com/u/jose.runin)\
**Post date:** [August 29, 2022, 4:30am UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/1 "2022-08-29T04:30:32Z")

</div>

Hi everybody,

I’ve been having a lot of trouble recently using the WebAuthentication process of the Auth0 Flutter SDK. I got it to work a couple of days ago, but started having issues with the logout process. After a couple of days, the login process stopped working.

The issue is that the redirection that the URI provided by webAuth is returning a ‘Not Found’ website. I’ve seen plenty of topics about how the android SDK has the same issue, and the solution was changing the scheme. I’ve already tried that, and I’ve also tried to use the auth0 sample on github which gave me the same result. Any help would be really apappreciated.

- Which SDK this is regarding: Flutter SDK
- SDK Version: 1.0.0
- Platform Version: Pixel 3a on API 32 emulated on m1 mac.
- Code Snippets/Error Messages/Supporting Details/Screenshots:  
 ![Screen Shot 2022-08-29 at 00.23.52](https://global.discourse-cdn.com/auth0/original/3X/0/2/02e43c06b52832eedeef589215f61d2b3f5cd561.png)

As a side note, I’ve been using vscode, and on the debug console it shows an Authorize URI, which is different from what Chrome on the Android Emulator shows. Copying that ‘Authorize URI’ on safari on macos shows the login web page without any issues.

 ![Screen Shot 2022-08-29 at 00.28.18](https://global.discourse-cdn.com/auth0/original/3X/0/c/0cc7a66705652e3ebc20bda2c6cb7de4fe561aef.png)

---

<div class="post-metadata">

**Author:** ![escifo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/escifo/32/25034_2.png) [@escifo](https://community.auth0.com/u/escifo)\
**Post date:** [September 1, 2022, 4:34pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/3 "2022-09-01T16:34:54Z")

</div>

Hi,  
Not helping, but I am running into the exact same error. In case you managed to figure it out, your solution will probably be very helpful to me 🙂

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 1, 2022, 11:22pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/4 "2022-09-01T23:22:00Z")

</div>

Hello @escifo and @jose.runin welcome to the community!

> [@jose.runin](#):
>
> I’ve been having a lot of trouble recently using the WebAuthentication process of the Auth0 Flutter SDK. I got it to work a couple of days ago, but started having issues with the logout process. After a couple of days, the login process stopped working.

Sorry to hear you’ve had trouble with the WebAuth process 😕

Going off of the [sample app](https://github.com/auth0-samples/auth0-flutter-samples) - I’ve just configured it to my auth0 domain and scheme of `demo` and was able to run it in both an emulator (Pixel 3a on API 32 emulated on intel MB pro) as well as on a physical device without issue (Google Pixel 5a Android 12). Both Login and Logout function as expected. Here’s my `strings.xml`:

```auto
<resources>
    <string name="com_auth0_domain">dev-XXXXX.us.auth0.com</string>
    <string name="com_auth0_scheme">demo</string>
</resources>

```

> [@jose.runin](#):
>
> As a side note, I’ve been using vscode, and on the debug console it shows an Authorize URI, which is different from what Chrome on the Android Emulator shows. Copying that ‘Authorize URI’ on safari on macos shows the login web page without any issues.

Interesting, I see the exact same logging but as I mentioned everything is functioning as expected 🤔

Do you both experience the same with a similar config, using a simple custom scheme? I’ve only seen this in the past with an `https` scheme.

Let us know!

---

<div class="post-metadata">

**Author:** ![jose.runin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jose.runin/32/34928_2.png) [@jose.runin](https://community.auth0.com/u/jose.runin)\
**Post date:** [September 2, 2022, 5:09am UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/5 "2022-09-02T05:09:27Z")

</div>

Thank you so much for reaching out, @ty.frith.

I may be missing something, but as soon as I change the scheme to ‘demo’ or ‘app’ or any other string which isn’t https, I get a Callback URL mismatch error.

It would be great if you could sort out what went wrong.

On another note, I got another emulator working on a Windows PC. I got to login and it worked great, but as soon as I got authenticated, I haven’t been able to see any other site which isn’t URL mismatch or not found.

Thanks again for reaching out!

---

<div class="post-metadata">

**Author:** ![escifo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/escifo/32/25034_2.png) [@escifo](https://community.auth0.com/u/escifo)\
**Post date:** [September 2, 2022, 10:26am UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/6 "2022-09-02T10:26:42Z")

</div>

Same as @jose.runin , I was having an error due to callback URL mismatch when changing the scheme. However, it seems I had it working by also specifying the scheme in the login call like this:

```
auth0.webAuthentication(scheme: "demo").login()

```

(same for logout)

Not sure this is the proper solution though (I am totally new to flutter, so not sure I understand what I am doing here 😃 )

Thanks for the hint @ty.frith, much appreciated!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 2, 2022, 3:32pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/7 "2022-09-02T15:32:51Z")

</div>

Thanks for the updates @escifo and @jose.runin!

> [@jose.runin](#):
>
> I may be missing something, but as soon as I change the scheme to ‘demo’ or ‘app’ or any other string which isn’t https, I get a Callback URL mismatch error.

This might just be due to the fact that you need to update/add the callback url in your application settings in Auth0: `demo://YOUR_AUTH0_DOMAIN/android/YOUR_PACKAGE_NAME/callback`

> [@escifo](#):
>
> Not sure this is the proper solution though (I am totally new to flutter, so not sure I understand what I am doing here 😃 )

All good, I’m still new to it as well! What you’ve done is correct though, see:

[https://auth0.com/docs/quickstart/native/flutter/interactive#add-login-to-your-app](https://auth0.com/docs/quickstart/native/flutter/interactive#add-login-to-your-app)

---

<div class="post-metadata">

**Author:** ![jose.runin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jose.runin/32/34928_2.png) [@jose.runin](https://community.auth0.com/u/jose.runin)\
**Post date:** [September 2, 2022, 8:08pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/8 "2022-09-02T20:08:06Z")

</div>

Thank you @escifo for the solution! I’m now using that and it’s working alright. I’m guessing the build.gradle isn’t updating the scheme on the auth0 framework, and that’s why we got the Callback URL mismatch error.

Thanks also to @ty.frith for the hints and the readiness!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 2, 2022, 9:20pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/9 "2022-09-02T21:20:54Z")

</div>

No problem, happy to help! Good to know it’s functioning as expected for you now 🙂

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 17, 2022, 9:21pm UTC](https://community.auth0.com/t/flutter-webauth-redirects-to-not-found-page/89557/10 "2022-09-17T21:21:30Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
