Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect_uri incorrect in auth0.onLoad(). #409

Open
6 tasks done
jwalton opened this issue Feb 15, 2024 · 0 comments
Open
6 tasks done

redirect_uri incorrect in auth0.onLoad(). #409

jwalton opened this issue Feb 15, 2024 · 0 comments
Labels
feature request A feature has been asked for or suggested by the community web

Comments

@jwalton
Copy link

jwalton commented Feb 15, 2024

Checklist

Description

When I login with:

_auth0 = Auth0Web(domain, clientId);
_auth0.loginWithRedirect(
  redirectUrl: 'http://localhost:8080/callback",
);

_auth0.onLoad().then((final credentials) { ... }

This works as expected. But, if I reload the page, the onLoad() attempts to do a "silent authentication" to recover my credentials and this fails. The onLoad() results in a network request being sent that looks like:

https://xxxx.auth0.com/authorize?...&redirect_uri=https%3A%2F%2Flocalhost%3A8080&...

And this fails, with the logs reporting "Failed Silent Auth: Callback URL mismatch. https://localhost:8080 is not in the list of allowed callback URLs."

This is correct: that URL is not in my list of allowed callback URLs, and nor do I want it to be. But, onLoad() doesn't seem to accept a redirectUrl as a parameter.

You can work around this with:

_auth0.onLoad(parameters: {'redirect_uri': _redirectUrl}).then((final credentials) {...})

But, yuck. It would be much nicer if the Auth0Web constructor accepted an optional redirectUri parameter like the js version does.

Reproduction

n/a

Additional context

No response

auth0_flutter version

1.5.0

Flutter version

3.20.0-7.0.pre.17

Platform

Web

Platform version(s)

No response

@Widcket Widcket added web feature request A feature has been asked for or suggested by the community labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community web
Projects
None yet
Development

No branches or pull requests

2 participants